1
1
/* SA-MP Functions
2
2
*
3
- * (c) Copyright 2005-2012 , SA-MP Team
3
+ * (c) Copyright 2005-2015 , SA-MP Team
4
4
*
5
5
*/
6
6
23
23
#include < a_players>
24
24
#include < a_vehicles>
25
25
#include < a_objects>
26
+ #include < a_actor>
26
27
#include < a_sampdb>
27
28
28
29
// Limits and internal constants
29
30
# define MAX_PLAYER_NAME (24 )
30
- # define MAX_PLAYERS (500 )
31
+ # define MAX_PLAYERS (1000 )
31
32
# define MAX_VEHICLES (2000 )
33
+ # define MAX_ACTORS (1000 )
32
34
# define INVALID_PLAYER_ID (0x FFFF )
33
35
# define INVALID_VEHICLE_ID (0x FFFF )
36
+ # define INVALID_ACTOR_ID (0x FFFF )
34
37
# define NO_TEAM (255 )
35
38
# define MAX_OBJECTS (1000 )
36
39
# define INVALID_OBJECT_ID (0x FFFF )
@@ -58,7 +61,8 @@ native SendClientMessage(playerid, color, const message[]);
58
61
native SendClientMessageToAll (color, const message[]);
59
62
native SendPlayerMessageToPlayer (playerid, senderid, const message[]);
60
63
native SendPlayerMessageToAll (senderid, const message[]);
61
- native SendDeathMessage (killer,killee,weapon);
64
+ native SendDeathMessage (killer, killee, weapon);
65
+ native SendDeathMessageToPlayer (playerid, killer, killee, weapon);
62
66
native GameTextForAll (const string[],time,style);
63
67
native GameTextForPlayer (playerid,const string[],time,style);
64
68
native SetTimer (funcname[], interval, repeating);
@@ -68,18 +72,44 @@ native GetTickCount();
68
72
native GetMaxPlayers ();
69
73
native CallRemoteFunction (const function[], const format[], {Float,_}: ...);
70
74
native CallLocalFunction (const function[], const format[], {Float,_}: ...);
75
+ native Float: VectorSize (Float: x, Float: y, Float: z);
71
76
native Float: asin (Float: value);
72
77
native Float: acos (Float: value);
73
78
native Float: atan (Float: value);
74
79
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[]);
75
105
76
106
// Game
77
107
native SetGameModeText (const string[]);
78
108
native SetTeamCount (count);
79
109
native AddPlayerClass (modelid, Float: spawn_x, Float: spawn_y, Float: spawn_z, Float: z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
80
110
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);
81
111
native AddStaticVehicle (modelid, Float: spawn_x, Float: spawn_y, Float: spawn_z, Float: z_angle, color1, color2);
82
- 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 );
83
113
native AddStaticPickup (model, type, Float: X, Float: Y, Float: Z, virtualworld = 0 );
84
114
native CreatePickup (model, type, Float: X, Float: Y, Float: Z, virtualworld = 0 );
85
115
native DestroyPickup (pickup);
@@ -114,12 +144,32 @@ native Kick(playerid);
114
144
native Ban (playerid);
115
145
native BanEx (playerid, const reason[]);
116
146
native SendRconCommand (command[]);
117
- native GetServerVarAsString (const varname[], buffer[], len);
118
- native GetServerVarAsInt (const varname[]);
119
- native GetServerVarAsBool (const varname[]);
120
147
native GetPlayerNetworkStats (playerid, retstr[], retstr_size);
121
148
native GetNetworkStats (retstr[], retstr_size);
122
149
native GetPlayerVersion (playerid, const version[], len); // Returns the SA-MP client revision as reported by the player
150
+ native BlockIpAddress (ip_address[], timems);
151
+ native UnBlockIpAddress (ip_address[]);
152
+
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
+
162
+ // Extended admin network stats
163
+ native GetServerTickRate ();
164
+ native NetStats_GetConnectedTime (playerid);
165
+ native NetStats_MessagesReceived (playerid);
166
+ native NetStats_BytesReceived (playerid);
167
+ native NetStats_MessagesSent (playerid);
168
+ native NetStats_BytesSent (playerid);
169
+ native NetStats_MessagesRecvPerSecond (playerid);
170
+ native Float: NetStats_PacketLossPercent (playerid);
171
+ native NetStats_ConnectionStatus (playerid);
172
+ native NetStats_GetIpPort (playerid, ip_port[], ip_port_len);
123
173
124
174
// Menu
125
175
native Menu: CreateMenu (const title[], columns, Float: x, Float: y, Float: col1width, Float: col2width = 0 .0 );
@@ -185,10 +235,12 @@ native DeletePlayer3DTextLabel(playerid, PlayerText3D:id);
185
235
native UpdatePlayer3DTextLabelText (playerid, PlayerText3D: id, color, text[]);
186
236
187
237
// Player GUI Dialog
188
- # define DIALOG_STYLE_MSGBOX 0
189
- # define DIALOG_STYLE_INPUT 1
190
- # define DIALOG_STYLE_LIST 2
191
- # 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
192
244
193
245
native ShowPlayerDialog (playerid, dialogid, style, caption[], info[], button1[], button2[]);
194
246
@@ -319,7 +371,7 @@ forward OnEnterExitModShop(playerid, enterexit, interiorid);
319
371
forward OnVehiclePaintjob (playerid, vehicleid, paintjobid);
320
372
forward OnVehicleRespray (playerid, vehicleid, color1, color2);
321
373
forward OnVehicleDamageStatusUpdate (vehicleid, playerid);
322
- forward OnUnoccupiedVehicleUpdate (vehicleid, playerid, passenger_seat);
374
+ forward OnUnoccupiedVehicleUpdate (vehicleid, playerid, passenger_seat, Float: new_x, Float: new_y, Float: new_z, Float: vel_x, Float: vel_y, Float: vel_z );
323
375
forward OnPlayerSelectedMenuRow (playerid, row);
324
376
forward OnPlayerExitedMenu (playerid);
325
377
forward OnPlayerInteriorChange (playerid, newinteriorid, oldinteriorid);
@@ -330,12 +382,18 @@ forward OnPlayerStreamIn(playerid, forplayerid);
330
382
forward OnPlayerStreamOut (playerid, forplayerid);
331
383
forward OnVehicleStreamIn (vehicleid, forplayerid);
332
384
forward OnVehicleStreamOut (vehicleid, forplayerid);
385
+ forward OnActorStreamIn (actorid, forplayerid);
386
+ forward OnActorStreamOut (actorid, forplayerid);
333
387
forward OnDialogResponse (playerid, dialogid, response, listitem, inputtext[]);
334
- forward OnPlayerTakeDamage (playerid, issuerid, Float: amount, weaponid);
335
- forward OnPlayerGiveDamage (playerid, damagedid, Float: amount, weaponid);
388
+ forward OnPlayerTakeDamage (playerid, issuerid, Float: amount, weaponid, bodypart);
389
+ forward OnPlayerGiveDamage (playerid, damagedid, Float: amount, weaponid, bodypart);
390
+ forward OnPlayerGiveDamageActor (playerid, damaged_actorid, Float: amount, weaponid, bodypart);
336
391
forward OnPlayerClickMap (playerid, Float: fX, Float: fY, Float: fZ);
337
392
forward OnPlayerClickTextDraw (playerid, Text: clickedid);
338
393
forward OnPlayerClickPlayerTextDraw (playerid, PlayerText: playertextid);
394
+ forward OnIncomingConnection (playerid, ip_address[], port);
395
+ forward OnTrailerUpdate (playerid, vehicleid);
396
+ forward OnVehicleSirenStateChange (playerid, vehicleid, newstate);
339
397
340
398
# define CLICK_SOURCE_SCOREBOARD 0
341
399
forward OnPlayerClickPlayer (playerid, clickedplayerid, source);
@@ -357,4 +415,12 @@ Float:fScaleX, Float:fScaleY, Float:fScaleZ );
357
415
358
416
forward OnPlayerSelectObject (playerid, type, objectid, modelid, Float: fX, Float: fY, Float: fZ);
359
417
418
+ # define BULLET_HIT_TYPE_NONE 0
419
+ # define BULLET_HIT_TYPE_PLAYER 1
420
+ # define BULLET_HIT_TYPE_VEHICLE 2
421
+ # define BULLET_HIT_TYPE_OBJECT 3
422
+ # define BULLET_HIT_TYPE_PLAYER_OBJECT 4
423
+
424
+ forward OnPlayerWeaponShot (playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float: fZ);
425
+
360
426
// --------------------------------------------------
0 commit comments