Skip to content

Commit 7b19498

Browse files
committed
0.3.7-R2-1-1
1 parent de2ed6d commit 7b19498

File tree

6 files changed

+122
-22
lines changed

6 files changed

+122
-22
lines changed

a_actor.inc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* SA-MP Actor Functions
2+
*
3+
* (c) Copyright 2015, SA-MP Team
4+
*
5+
*/
6+
7+
#if defined _actor_included
8+
#endinput
9+
#endif
10+
#define _actor_included
11+
#pragma library actors
12+
13+
native CreateActor(modelid, Float:X, Float:Y, Float:Z, Float:Rotation);
14+
native DestroyActor(actorid);
15+
16+
native IsActorStreamedIn(actorid, forplayerid);
17+
18+
native SetActorVirtualWorld(actorid, vworld);
19+
native GetActorVirtualWorld(actorid);
20+
21+
native ApplyActorAnimation(actorid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time);
22+
native ClearActorAnimations(actorid);
23+
24+
native SetActorPos(actorid, Float:X, Float:Y, Float:Z);
25+
native GetActorPos(actorid, &Float:X, &Float:Y, &Float:Z);
26+
native SetActorFacingAngle(actorid, Float:ang);
27+
native GetActorFacingAngle(actorid, &Float:ang);
28+
29+
native SetActorHealth(actorid, Float:health);
30+
native GetActorHealth(actorid, &Float:health);
31+
native SetActorInvulnerable(actorid, invulnerable = true);
32+
native IsActorInvulnerable(actorid);
33+
34+
native IsValidActor(actorid);

a_objects.inc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SA-MP Object Functions
22
*
3-
* (c) Copyright 2005-2012, SA-MP Team
3+
* (c) Copyright 2005-2015, SA-MP Team
44
*
55
*/
66
@@ -20,6 +20,8 @@ native SetObjectPos(objectid, Float:X, Float:Y, Float:Z);
2020
native GetObjectPos(objectid, &Float:X, &Float:Y, &Float:Z);
2121
native SetObjectRot(objectid, Float:RotX, Float:RotY, Float:RotZ);
2222
native GetObjectRot(objectid, &Float:RotX, &Float:RotY, &Float:RotZ);
23+
native GetObjectModel(objectid);
24+
native SetObjectNoCameraCol(objectid);
2325
native IsValidObject(objectid);
2426
native DestroyObject(objectid);
2527
native MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0);
@@ -35,6 +37,8 @@ native SetPlayerObjectPos(playerid, objectid, Float:X, Float:Y, Float:Z);
3537
native GetPlayerObjectPos(playerid, objectid, &Float:X, &Float:Y, &Float:Z);
3638
native SetPlayerObjectRot(playerid, objectid, Float:RotX, Float:RotY, Float:RotZ);
3739
native GetPlayerObjectRot(playerid, objectid, &Float:RotX, &Float:RotY, &Float:RotZ);
40+
native GetPlayerObjectModel(playerid, objectid);
41+
native SetPlayerObjectNoCameraCol(playerid, objectid);
3842
native IsValidPlayerObject(playerid, objectid);
3943
native DestroyPlayerObject(playerid, objectid);
4044
native MovePlayerObject(playerid, objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0);
@@ -65,4 +69,6 @@ native SetObjectMaterial(objectid, materialindex, modelid, txdname[], texturenam
6569
native SetPlayerObjectMaterial(playerid, objectid, materialindex, modelid, txdname[], texturename[], materialcolor=0);
6670
6771
native SetObjectMaterialText(objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
68-
native SetPlayerObjectMaterialText(playerid, objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
72+
native SetPlayerObjectMaterialText(playerid, objectid, text[], materialindex = 0, materialsize = OBJECT_MATERIAL_SIZE_256x128, fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);
73+
74+
native SetObjectsDefaultCameraCol(disable);

a_players.inc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SA-MP Player Functions
22
*
3-
* (c) Copyright 2005-2014, SA-MP Team
3+
* (c) Copyright 2005-2015, SA-MP Team
44
*
55
*/
66
@@ -78,6 +78,7 @@ native SetPlayerAmmo(playerid, weaponslot, ammo);
7878
native GetPlayerAmmo(playerid);
7979
native GetPlayerWeaponState(playerid);
8080
native GetPlayerTargetPlayer(playerid);
81+
native GetPlayerTargetActor(playerid);
8182
native SetPlayerTeam(playerid, teamid);
8283
native GetPlayerTeam(playerid);
8384
native SetPlayerScore(playerid,score);
@@ -176,7 +177,7 @@ native GetPVarType(playerid, varname[]);
176177
#define MAX_CHATBUBBLE_LENGTH 144
177178
native SetPlayerChatBubble(playerid, text[], color, Float:drawdistance, expiretime);
178179
179-
// Player controls
180+
// Player control
180181
native PutPlayerInVehicle(playerid, vehicleid, seatid);
181182
native GetPlayerVehicleID(playerid);
182183
native GetPlayerVehicleSeat(playerid);
@@ -189,6 +190,7 @@ native GetPlayerAnimationIndex(playerid); // return the index of any running app
189190
native GetAnimationName(index, animlib[], len1, animname[], len2); // get the animation lib/name for the index
190191
native GetPlayerSpecialAction(playerid);
191192
native SetPlayerSpecialAction(playerid,actionid);
193+
native DisableRemoteVehicleCollisions(playerid, disable);
192194
193195
// Player world/map related
194196
native SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
@@ -220,6 +222,11 @@ native SetCameraBehindPlayer(playerid);
220222
native GetPlayerCameraPos(playerid, &Float:x, &Float:y, &Float:z);
221223
native GetPlayerCameraFrontVector(playerid, &Float:x, &Float:y, &Float:z);
222224
native GetPlayerCameraMode(playerid);
225+
native EnablePlayerCameraTarget(playerid, enable);
226+
native GetPlayerCameraTargetObject(playerid);
227+
native GetPlayerCameraTargetVehicle(playerid);
228+
native GetPlayerCameraTargetPlayer(playerid);
229+
native GetPlayerCameraTargetActor(playerid);
223230
native Float:GetPlayerCameraAspectRatio(playerid);
224231
native Float:GetPlayerCameraZoom(playerid);
225232
native AttachCameraToObject(playerid, objectid);

a_samp.inc

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SA-MP Functions
22
*
3-
* (c) Copyright 2005-2014, SA-MP Team
3+
* (c) Copyright 2005-2015, SA-MP Team
44
*
55
*/
66
@@ -23,14 +23,17 @@
2323
#include <a_players>
2424
#include <a_vehicles>
2525
#include <a_objects>
26+
#include <a_actor>
2627
#include <a_sampdb>
2728
2829
// Limits and internal constants
2930
#define MAX_PLAYER_NAME (24)
30-
#define MAX_PLAYERS (500)
31+
#define MAX_PLAYERS (1000)
3132
#define MAX_VEHICLES (2000)
33+
#define MAX_ACTORS (1000)
3234
#define INVALID_PLAYER_ID (0xFFFF)
3335
#define INVALID_VEHICLE_ID (0xFFFF)
36+
#define INVALID_ACTOR_ID (0xFFFF)
3437
#define NO_TEAM (255)
3538
#define MAX_OBJECTS (1000)
3639
#define INVALID_OBJECT_ID (0xFFFF)
@@ -74,14 +77,39 @@ native Float:asin(Float:value);
7477
native Float:acos(Float:value);
7578
native Float:atan(Float:value);
7679
native Float:atan2(Float:x, Float:y);
80+
native GetPlayerPoolSize();
81+
native GetVehiclePoolSize();
82+
native GetActorPoolSize();
83+
84+
// Hash
85+
native SHA256_PassHash(password[], salt[], ret_hash[], ret_hash_len); // SHA256 for password hashing
86+
87+
// Server wide persistent variable system (SVars)
88+
native SetSVarInt(varname[], int_value);
89+
native GetSVarInt(varname[]);
90+
native SetSVarString(varname[], string_value[]);
91+
native GetSVarString(varname[], string_return[], len);
92+
native SetSVarFloat(varname[], Float:float_value);
93+
native Float:GetSVarFloat(varname[]);
94+
native DeleteSVar(varname[]);
95+
96+
// SVar enumeration
97+
#define SERVER_VARTYPE_NONE 0
98+
#define SERVER_VARTYPE_INT 1
99+
#define SERVER_VARTYPE_STRING 2
100+
#define SERVER_VARTYPE_FLOAT 3
101+
102+
native GetSVarsUpperIndex();
103+
native GetSVarNameAtIndex(index, ret_varname[], ret_len);
104+
native GetSVarType(varname[]);
77105
78106
// Game
79107
native SetGameModeText(const string[]);
80108
native SetTeamCount(count);
81109
native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
82110
native AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
83111
native AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
84-
native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay);
112+
native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren=0);
85113
native AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
86114
native CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
87115
native DestroyPickup(pickup);
@@ -116,15 +144,21 @@ native Kick(playerid);
116144
native Ban(playerid);
117145
native BanEx(playerid, const reason[]);
118146
native SendRconCommand(command[]);
119-
native GetServerVarAsString(const varname[], buffer[], len);
120-
native GetServerVarAsInt(const varname[]);
121-
native GetServerVarAsBool(const varname[]);
122147
native GetPlayerNetworkStats(playerid, retstr[], retstr_size);
123148
native GetNetworkStats(retstr[], retstr_size);
124149
native GetPlayerVersion(playerid, const version[], len); // Returns the SA-MP client revision as reported by the player
125150
native BlockIpAddress(ip_address[], timems);
126151
native UnBlockIpAddress(ip_address[]);
127152
153+
// Deprecated:
154+
native GetServerVarAsString(const varname[], buffer[], len);
155+
native GetServerVarAsInt(const varname[]);
156+
native GetServerVarAsBool(const varname[]);
157+
// These are the same 3 functions as above although they avoid the name ambiguity/conflict with the SVar system.
158+
native GetConsoleVarAsString(const varname[], buffer[], len);
159+
native GetConsoleVarAsInt(const varname[]);
160+
native GetConsoleVarAsBool(const varname[]);
161+
128162
// Extended admin network stats
129163
native GetServerTickRate();
130164
native NetStats_GetConnectedTime(playerid);
@@ -201,10 +235,12 @@ native DeletePlayer3DTextLabel(playerid, PlayerText3D:id);
201235
native UpdatePlayer3DTextLabelText(playerid, PlayerText3D:id, color, text[]);
202236
203237
// Player GUI Dialog
204-
#define DIALOG_STYLE_MSGBOX 0
205-
#define DIALOG_STYLE_INPUT 1
206-
#define DIALOG_STYLE_LIST 2
207-
#define DIALOG_STYLE_PASSWORD 3
238+
#define DIALOG_STYLE_MSGBOX 0
239+
#define DIALOG_STYLE_INPUT 1
240+
#define DIALOG_STYLE_LIST 2
241+
#define DIALOG_STYLE_PASSWORD 3
242+
#define DIALOG_STYLE_TABLIST 4
243+
#define DIALOG_STYLE_TABLIST_HEADERS 5
208244
209245
native ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
210246
@@ -346,14 +382,18 @@ forward OnPlayerStreamIn(playerid, forplayerid);
346382
forward OnPlayerStreamOut(playerid, forplayerid);
347383
forward OnVehicleStreamIn(vehicleid, forplayerid);
348384
forward OnVehicleStreamOut(vehicleid, forplayerid);
385+
forward OnActorStreamIn(actorid, forplayerid);
386+
forward OnActorStreamOut(actorid, forplayerid);
349387
forward OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
350388
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
351389
forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
390+
forward OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart);
352391
forward OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
353392
forward OnPlayerClickTextDraw(playerid, Text:clickedid);
354393
forward OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
355394
forward OnIncomingConnection(playerid, ip_address[], port);
356395
forward OnTrailerUpdate(playerid, vehicleid);
396+
forward OnVehicleSirenStateChange(playerid, vehicleid, newstate);
357397
358398
#define CLICK_SOURCE_SCOREBOARD 0
359399
forward OnPlayerClickPlayer(playerid, clickedplayerid, source);

a_sampdb.inc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
/* SA-MP Native SQLite Database Functions
2-
*
3-
* (c) Copyright 2007, SA-MP Team
4-
*
5-
*/
1+
// SA-MP Native SQLite Database Functions
2+
//
3+
// (c) Copyright 2015, SA-MP Team
4+
//
65
76
#if defined _sampdb_included
87
#endinput
@@ -12,11 +11,20 @@
1211
1312
native DB:db_open(name[]);
1413
native db_close(DB:db);
15-
native DBResult:db_query(DB:db,query[]);
14+
native DBResult:db_query(DB:db, query[]);
1615
native db_free_result(DBResult:dbresult);
1716
native db_num_rows(DBResult:dbresult);
1817
native db_next_row(DBResult:dbresult);
1918
native db_num_fields(DBResult:dbresult);
2019
native db_field_name(DBResult:dbresult, field, result[], maxlength);
2120
native db_get_field(DBResult:dbresult, field, result[], maxlength);
22-
native db_get_field_assoc(DBResult:dbresult, const field[], result[], maxlength);
21+
native db_get_field_int(DBResult:result, field = 0);
22+
native Float:db_get_field_float(DBResult:result, field = 0);
23+
native db_get_field_assoc(DBResult:dbresult, const field[], result[], maxlength);
24+
native db_get_field_assoc_int(DBResult:result, const field[]);
25+
native Float:db_get_field_assoc_float(DBResult:result, const field[]);
26+
native db_get_mem_handle(DB:db);
27+
native db_get_result_mem_handle(DBResult:result);
28+
29+
native db_debug_openfiles();
30+
native db_debug_openresults();

a_vehicles.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define VEHICLE_PARAMS_ON 1
3131
3232
// Vehicle
33-
native CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay);
33+
native CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren=0);
3434
native DestroyVehicle(vehicleid);
3535
native IsVehicleStreamedIn(vehicleid, forplayerid);
3636
native GetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z);
@@ -43,6 +43,11 @@ native SetVehicleParamsForPlayer(vehicleid,playerid,objective,doorslocked);
4343
native ManualVehicleEngineAndLights();
4444
native SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
4545
native GetVehicleParamsEx(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective);
46+
native GetVehicleParamsSirenState(vehicleid);
47+
native SetVehicleParamsCarDoors(vehicleid, driver, passenger, backleft, backright);
48+
native GetVehicleParamsCarDoors(vehicleid, &driver, &passenger, &backleft, &backright);
49+
native SetVehicleParamsCarWindows(vehicleid, driver, passenger, backleft, backright);
50+
native GetVehicleParamsCarWindows(vehicleid, &driver, &passenger, &backleft, &backright);
4651
native SetVehicleToRespawn(vehicleid);
4752
native LinkVehicleToInterior(vehicleid, interiorid);
4853
native AddVehicleComponent(vehicleid, componentid);

0 commit comments

Comments
 (0)