Skip to content

Commit d7f74bf

Browse files
committed
Update standart samp libs
in example amx gamemode folder
1 parent 80e27bd commit d7f74bf

File tree

7 files changed

+159
-539
lines changed

7 files changed

+159
-539
lines changed

amx-test/pawno/include/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);

amx-test/pawno/include/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);

amx-test/pawno/include/a_players.inc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SA-MP Player Functions
22
*
3-
* (c) Copyright 2005-2012, 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);
@@ -121,6 +122,7 @@ native SetPlayerSkillLevel(playerid, skill, level);
121122
native GetPlayerSurfingVehicleID(playerid);
122123
native GetPlayerSurfingObjectID(playerid);
123124
native RemoveBuildingForPlayer(playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius);
125+
native GetPlayerLastShotVectors(playerid, &Float:fOriginX, &Float:fOriginY, &Float:fOriginZ, &Float:fHitPosX, &Float:fHitPosY, &Float:fHitPosZ);
124126
125127
// Attached to bone objects
126128
@@ -175,7 +177,7 @@ native GetPVarType(playerid, varname[]);
175177
#define MAX_CHATBUBBLE_LENGTH 144
176178
native SetPlayerChatBubble(playerid, text[], color, Float:drawdistance, expiretime);
177179
178-
// Player controls
180+
// Player control
179181
native PutPlayerInVehicle(playerid, vehicleid, seatid);
180182
native GetPlayerVehicleID(playerid);
181183
native GetPlayerVehicleSeat(playerid);
@@ -188,6 +190,7 @@ native GetPlayerAnimationIndex(playerid); // return the index of any running app
188190
native GetAnimationName(index, animlib[], len1, animname[], len2); // get the animation lib/name for the index
189191
native GetPlayerSpecialAction(playerid);
190192
native SetPlayerSpecialAction(playerid,actionid);
193+
native DisableRemoteVehicleCollisions(playerid, disable);
191194
192195
// Player world/map related
193196
native SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
@@ -219,6 +222,13 @@ native SetCameraBehindPlayer(playerid);
219222
native GetPlayerCameraPos(playerid, &Float:x, &Float:y, &Float:z);
220223
native GetPlayerCameraFrontVector(playerid, &Float:x, &Float:y, &Float:z);
221224
native GetPlayerCameraMode(playerid);
225+
native EnablePlayerCameraTarget(playerid, enable);
226+
native GetPlayerCameraTargetObject(playerid);
227+
native GetPlayerCameraTargetVehicle(playerid);
228+
native GetPlayerCameraTargetPlayer(playerid);
229+
native GetPlayerCameraTargetActor(playerid);
230+
native Float:GetPlayerCameraAspectRatio(playerid);
231+
native Float:GetPlayerCameraZoom(playerid);
222232
native AttachCameraToObject(playerid, objectid);
223233
native AttachCameraToPlayerObject(playerid, playerobjectid);
224234
native InterpolateCameraPos(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
@@ -257,4 +267,7 @@ native StartRecordingPlayerData(playerid, recordtype, recordname[]);
257267
native StopRecordingPlayerData(playerid);
258268
259269
native SelectTextDraw(playerid, hovercolor); // enables the mouse so the player can select a textdraw
260-
native CancelSelectTextDraw(playerid); // cancel textdraw selection with the mouse
270+
native CancelSelectTextDraw(playerid); // cancel textdraw selection with the mouse
271+
272+
// Explosion
273+
native CreateExplosionForPlayer(playerid, Float:X, Float:Y, Float:Z, type, Float:Radius);

amx-test/pawno/include/a_samp.inc

Lines changed: 80 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SA-MP Functions
22
*
3-
* (c) Copyright 2005-2012, 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)
@@ -58,7 +61,8 @@ native SendClientMessage(playerid, color, const message[]);
5861
native SendClientMessageToAll(color, const message[]);
5962
native SendPlayerMessageToPlayer(playerid, senderid, const message[]);
6063
native SendPlayerMessageToAll(senderid, const message[]);
61-
native SendDeathMessage(killer,killee,weapon);
64+
native SendDeathMessage(killer, killee, weapon);
65+
native SendDeathMessageToPlayer(playerid, killer, killee, weapon);
6266
native GameTextForAll(const string[],time,style);
6367
native GameTextForPlayer(playerid,const string[],time,style);
6468
native SetTimer(funcname[], interval, repeating);
@@ -68,18 +72,44 @@ native GetTickCount();
6872
native GetMaxPlayers();
6973
native CallRemoteFunction(const function[], const format[], {Float,_}:...);
7074
native CallLocalFunction(const function[], const format[], {Float,_}:...);
75+
native Float:VectorSize(Float:x, Float:y, Float:z);
7176
native Float:asin(Float:value);
7277
native Float:acos(Float:value);
7378
native Float:atan(Float:value);
7479
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[]);
75105
76106
// Game
77107
native SetGameModeText(const string[]);
78108
native SetTeamCount(count);
79109
native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
80110
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);
81111
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);
83113
native AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
84114
native CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
85115
native DestroyPickup(pickup);
@@ -114,12 +144,32 @@ native Kick(playerid);
114144
native Ban(playerid);
115145
native BanEx(playerid, const reason[]);
116146
native SendRconCommand(command[]);
117-
native GetServerVarAsString(const varname[], buffer[], len);
118-
native GetServerVarAsInt(const varname[]);
119-
native GetServerVarAsBool(const varname[]);
120147
native GetPlayerNetworkStats(playerid, retstr[], retstr_size);
121148
native GetNetworkStats(retstr[], retstr_size);
122149
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);
123173
124174
// Menu
125175
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);
185235
native UpdatePlayer3DTextLabelText(playerid, PlayerText3D:id, color, text[]);
186236
187237
// 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
192244
193245
native ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
194246
@@ -319,7 +371,7 @@ forward OnEnterExitModShop(playerid, enterexit, interiorid);
319371
forward OnVehiclePaintjob(playerid, vehicleid, paintjobid);
320372
forward OnVehicleRespray(playerid, vehicleid, color1, color2);
321373
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);
323375
forward OnPlayerSelectedMenuRow(playerid, row);
324376
forward OnPlayerExitedMenu(playerid);
325377
forward OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
@@ -330,12 +382,18 @@ forward OnPlayerStreamIn(playerid, forplayerid);
330382
forward OnPlayerStreamOut(playerid, forplayerid);
331383
forward OnVehicleStreamIn(vehicleid, forplayerid);
332384
forward OnVehicleStreamOut(vehicleid, forplayerid);
385+
forward OnActorStreamIn(actorid, forplayerid);
386+
forward OnActorStreamOut(actorid, forplayerid);
333387
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);
336391
forward OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
337392
forward OnPlayerClickTextDraw(playerid, Text:clickedid);
338393
forward OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
394+
forward OnIncomingConnection(playerid, ip_address[], port);
395+
forward OnTrailerUpdate(playerid, vehicleid);
396+
forward OnVehicleSirenStateChange(playerid, vehicleid, newstate);
339397
340398
#define CLICK_SOURCE_SCOREBOARD 0
341399
forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
@@ -357,4 +415,12 @@ Float:fScaleX, Float:fScaleY, Float:fScaleZ );
357415
358416
forward OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
359417
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+
360426
// --------------------------------------------------

amx-test/pawno/include/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();

amx-test/pawno/include/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)