mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Add PAWN language
This commit is contained in:
		| @@ -1172,6 +1172,14 @@ Oxygene: | |||||||
|   color: "#5a63a3" |   color: "#5a63a3" | ||||||
|   primary_extension: .oxygene |   primary_extension: .oxygene | ||||||
|  |  | ||||||
|  | PAWN: | ||||||
|  |   type: programming | ||||||
|  |   lexer: C++ | ||||||
|  |   color: "#dbb284" | ||||||
|  |   primary_extension: .pwn | ||||||
|  |   extensions: | ||||||
|  |   - .inc  | ||||||
|  |    | ||||||
| PHP: | PHP: | ||||||
|   type: programming |   type: programming | ||||||
|   ace_mode: php |   ace_mode: php | ||||||
|   | |||||||
							
								
								
									
										361
									
								
								samples/PAWN/a_samp.inc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										361
									
								
								samples/PAWN/a_samp.inc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,361 @@ | |||||||
|  | /*  SA-MP Functions | ||||||
|  |  * | ||||||
|  |  *  (c) Copyright 2005-2012, SA-MP Team | ||||||
|  |  * | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | #if defined _samp_included | ||||||
|  | 	#endinput | ||||||
|  | #endif | ||||||
|  | #define _samp_included | ||||||
|  | #pragma library samp | ||||||
|  |  | ||||||
|  | #pragma tabsize 4 | ||||||
|  | // Ignores warning 217 for properly indented PAWNO code | ||||||
|  | // It's tab size is 4 and often uses 4 spaces instead, PAWNCC's is 8 | ||||||
|  |  | ||||||
|  | #include <core> | ||||||
|  | #include <float> | ||||||
|  | #include <string> | ||||||
|  | #include <file> | ||||||
|  | #include <time> | ||||||
|  | #include <datagram> | ||||||
|  | #include <a_players> | ||||||
|  | #include <a_vehicles> | ||||||
|  | #include <a_objects> | ||||||
|  | #include <a_sampdb> | ||||||
|  |  | ||||||
|  | // Limits and internal constants | ||||||
|  | #define MAX_PLAYER_NAME							(24) | ||||||
|  | #define MAX_PLAYERS								(500) | ||||||
|  | #define MAX_VEHICLES							(2000) | ||||||
|  | #define INVALID_PLAYER_ID						(0xFFFF) | ||||||
|  | #define INVALID_VEHICLE_ID						(0xFFFF) | ||||||
|  | #define NO_TEAM									(255) | ||||||
|  | #define MAX_OBJECTS								(1000) | ||||||
|  | #define INVALID_OBJECT_ID						(0xFFFF) | ||||||
|  | #define MAX_GANG_ZONES							(1024) | ||||||
|  | #define MAX_TEXT_DRAWS							(2048) | ||||||
|  | #define MAX_PLAYER_TEXT_DRAWS					(256) | ||||||
|  | #define MAX_MENUS								(128) | ||||||
|  | #define MAX_3DTEXT_GLOBAL						(1024) | ||||||
|  | #define MAX_3DTEXT_PLAYER						(1024) | ||||||
|  | #define MAX_PICKUPS								(4096) | ||||||
|  | #define INVALID_MENU							(0xFF) | ||||||
|  | #define INVALID_TEXT_DRAW						(0xFFFF) | ||||||
|  | #define INVALID_GANG_ZONE						(-1) | ||||||
|  | #define INVALID_3DTEXT_ID						(0xFFFF) | ||||||
|  |  | ||||||
|  | // -------------------------------------------------- | ||||||
|  | // Natives | ||||||
|  | // -------------------------------------------------- | ||||||
|  |  | ||||||
|  | // Utility | ||||||
|  | native IsValidVehicle(vehicleid); | ||||||
|  | native print(const string[]); | ||||||
|  | native printf(const format[], {Float,_}:...); | ||||||
|  | native format(output[], len, const format[], {Float,_}:...); | ||||||
|  | native SendClientMessage(playerid, color, const message[]); | ||||||
|  | native SendClientMessageToAll(color, const message[]); | ||||||
|  | native SendPlayerMessageToPlayer(playerid, senderid, const message[]); | ||||||
|  | native SendPlayerMessageToAll(senderid, const message[]); | ||||||
|  | native SendDeathMessage(killer,killee,weapon); | ||||||
|  | native GameTextForAll(const string[],time,style); | ||||||
|  | native GameTextForPlayer(playerid,const string[],time,style); | ||||||
|  | native SetTimer(funcname[], interval, repeating); | ||||||
|  | native SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...); | ||||||
|  | native KillTimer(timerid); | ||||||
|  | native GetTickCount(); | ||||||
|  | native GetMaxPlayers(); | ||||||
|  | native CallRemoteFunction(const function[], const format[], {Float,_}:...); | ||||||
|  | native CallLocalFunction(const function[], const format[], {Float,_}:...); | ||||||
|  | native Float:asin(Float:value); | ||||||
|  | native Float:acos(Float:value); | ||||||
|  | native Float:atan(Float:value); | ||||||
|  | native Float:atan2(Float:x, Float:y); | ||||||
|  |  | ||||||
|  | // Game | ||||||
|  | native SetGameModeText(const string[]); | ||||||
|  | native SetTeamCount(count); | ||||||
|  | native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | ||||||
|  | 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); | ||||||
|  | native AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2); | ||||||
|  | native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay); | ||||||
|  | native AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0); | ||||||
|  | native CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0); | ||||||
|  | native DestroyPickup(pickup); | ||||||
|  | native ShowNameTags(show); | ||||||
|  | native ShowPlayerMarkers(mode); | ||||||
|  | native GameModeExit(); | ||||||
|  | native SetWorldTime(hour); | ||||||
|  | native GetWeaponName(weaponid, const weapon[], len); | ||||||
|  | native EnableTirePopping(enable); // deprecated function | ||||||
|  | native EnableVehicleFriendlyFire(); | ||||||
|  | native AllowInteriorWeapons(allow); | ||||||
|  | native SetWeather(weatherid); | ||||||
|  | native SetGravity(Float:gravity); | ||||||
|  | native AllowAdminTeleport(allow); | ||||||
|  | native SetDeathDropAmount(amount); | ||||||
|  | native CreateExplosion(Float:X, Float:Y, Float:Z, type, Float:Radius); | ||||||
|  | native EnableZoneNames(enable); | ||||||
|  | native UsePlayerPedAnims();		// Will cause the players to use CJ running/walking animations | ||||||
|  | native DisableInteriorEnterExits();  // will disable all interior enter/exits in the game. | ||||||
|  | native SetNameTagDrawDistance(Float:distance); // Distance at which nametags will start rendering on the client. | ||||||
|  | native DisableNameTagLOS(); // Disables the nametag Line-Of-Sight checking | ||||||
|  | native LimitGlobalChatRadius(Float:chat_radius); | ||||||
|  | native LimitPlayerMarkerRadius(Float:marker_radius); | ||||||
|  |  | ||||||
|  | // Npc | ||||||
|  | native ConnectNPC(name[], script[]); | ||||||
|  | native IsPlayerNPC(playerid); | ||||||
|  |  | ||||||
|  | // Admin | ||||||
|  | native IsPlayerAdmin(playerid); | ||||||
|  | native Kick(playerid); | ||||||
|  | native Ban(playerid); | ||||||
|  | native BanEx(playerid, const reason[]); | ||||||
|  | native SendRconCommand(command[]); | ||||||
|  | native GetServerVarAsString(const varname[], buffer[], len); | ||||||
|  | native GetServerVarAsInt(const varname[]); | ||||||
|  | native GetServerVarAsBool(const varname[]); | ||||||
|  | native GetPlayerNetworkStats(playerid, retstr[], retstr_size); | ||||||
|  | native GetNetworkStats(retstr[], retstr_size); | ||||||
|  | native GetPlayerVersion(playerid, const version[], len); // Returns the SA-MP client revision as reported by the player | ||||||
|  |  | ||||||
|  | // Menu | ||||||
|  | native Menu:CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0); | ||||||
|  | native DestroyMenu(Menu:menuid); | ||||||
|  | native AddMenuItem(Menu:menuid, column, const menutext[]); | ||||||
|  | native SetMenuColumnHeader(Menu:menuid, column, const columnheader[]); | ||||||
|  | native ShowMenuForPlayer(Menu:menuid, playerid); | ||||||
|  | native HideMenuForPlayer(Menu:menuid, playerid); | ||||||
|  | native IsValidMenu(Menu:menuid); | ||||||
|  | native DisableMenu(Menu:menuid); | ||||||
|  | native DisableMenuRow(Menu:menuid, row); | ||||||
|  | native Menu:GetPlayerMenu(playerid); | ||||||
|  |  | ||||||
|  | // Text Draw | ||||||
|  | #define TEXT_DRAW_FONT_SPRITE_DRAW	 4 | ||||||
|  | #define TEXT_DRAW_FONT_MODEL_PREVIEW 5 | ||||||
|  |  | ||||||
|  | native Text:TextDrawCreate(Float:x, Float:y, text[]); | ||||||
|  | native TextDrawDestroy(Text:text); | ||||||
|  | native TextDrawLetterSize(Text:text, Float:x, Float:y); | ||||||
|  | native TextDrawTextSize(Text:text, Float:x, Float:y); | ||||||
|  | native TextDrawAlignment(Text:text, alignment); | ||||||
|  | native TextDrawColor(Text:text, color); | ||||||
|  | native TextDrawUseBox(Text:text, use); | ||||||
|  | native TextDrawBoxColor(Text:text, color); | ||||||
|  | native TextDrawSetShadow(Text:text, size); | ||||||
|  | native TextDrawSetOutline(Text:text, size); | ||||||
|  | native TextDrawBackgroundColor(Text:text, color); | ||||||
|  | native TextDrawFont(Text:text, font); | ||||||
|  | native TextDrawSetProportional(Text:text, set); | ||||||
|  | native TextDrawSetSelectable(Text:text, set); | ||||||
|  | native TextDrawShowForPlayer(playerid, Text:text); | ||||||
|  | native TextDrawHideForPlayer(playerid, Text:text); | ||||||
|  | native TextDrawShowForAll(Text:text); | ||||||
|  | native TextDrawHideForAll(Text:text); | ||||||
|  | native TextDrawSetString(Text:text, string[]); | ||||||
|  | native TextDrawSetPreviewModel(Text:text, modelindex); | ||||||
|  | native TextDrawSetPreviewRot(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0); | ||||||
|  | native TextDrawSetPreviewVehCol(Text:text, color1, color2); | ||||||
|  |  | ||||||
|  | // Gang Zones | ||||||
|  | native GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy); | ||||||
|  | native GangZoneDestroy(zone); | ||||||
|  | native GangZoneShowForPlayer(playerid, zone, color); | ||||||
|  | native GangZoneShowForAll(zone, color); | ||||||
|  | native GangZoneHideForPlayer(playerid, zone); | ||||||
|  | native GangZoneHideForAll(zone); | ||||||
|  | native GangZoneFlashForPlayer(playerid, zone, flashcolor); | ||||||
|  | native GangZoneFlashForAll(zone, flashcolor); | ||||||
|  | native GangZoneStopFlashForPlayer(playerid, zone); | ||||||
|  | native GangZoneStopFlashForAll(zone); | ||||||
|  |  | ||||||
|  | // Global 3D Text Labels | ||||||
|  | native Text3D:Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS=0); | ||||||
|  | native Delete3DTextLabel(Text3D:id); | ||||||
|  | native Attach3DTextLabelToPlayer(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ); | ||||||
|  | native Attach3DTextLabelToVehicle(Text3D:id, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ); | ||||||
|  | native Update3DTextLabelText(Text3D:id, color, text[]); | ||||||
|  |  | ||||||
|  | // Per-player 3D Text Labels | ||||||
|  | native PlayerText3D:CreatePlayer3DTextLabel(playerid, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer=INVALID_PLAYER_ID, attachedvehicle=INVALID_VEHICLE_ID, testLOS=0); | ||||||
|  | native DeletePlayer3DTextLabel(playerid, PlayerText3D:id); | ||||||
|  | native UpdatePlayer3DTextLabelText(playerid, PlayerText3D:id, color, text[]); | ||||||
|  |  | ||||||
|  | // Player GUI Dialog | ||||||
|  | #define DIALOG_STYLE_MSGBOX		0 | ||||||
|  | #define DIALOG_STYLE_INPUT		1 | ||||||
|  | #define DIALOG_STYLE_LIST		2 | ||||||
|  | #define DIALOG_STYLE_PASSWORD	3 | ||||||
|  |  | ||||||
|  | native ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]); | ||||||
|  |  | ||||||
|  | // -------------------------------------------------- | ||||||
|  | // Defines | ||||||
|  | // -------------------------------------------------- | ||||||
|  |  | ||||||
|  | // States | ||||||
|  | #define PLAYER_STATE_NONE						(0) | ||||||
|  | #define PLAYER_STATE_ONFOOT						(1) | ||||||
|  | #define PLAYER_STATE_DRIVER						(2) | ||||||
|  | #define PLAYER_STATE_PASSENGER					(3) | ||||||
|  | #define PLAYER_STATE_EXIT_VEHICLE				(4) // (used internally) | ||||||
|  | #define PLAYER_STATE_ENTER_VEHICLE_DRIVER		(5) // (used internally) | ||||||
|  | #define PLAYER_STATE_ENTER_VEHICLE_PASSENGER	(6) // (used internally) | ||||||
|  | #define PLAYER_STATE_WASTED						(7) | ||||||
|  | #define PLAYER_STATE_SPAWNED					(8) | ||||||
|  | #define PLAYER_STATE_SPECTATING					(9) | ||||||
|  |  | ||||||
|  | // Marker modes used by ShowPlayerMarkers() | ||||||
|  | #define PLAYER_MARKERS_MODE_OFF			(0) | ||||||
|  | #define PLAYER_MARKERS_MODE_GLOBAL		(1) | ||||||
|  | #define PLAYER_MARKERS_MODE_STREAMED	(2) | ||||||
|  |  | ||||||
|  | // Weapons | ||||||
|  | #define WEAPON_BRASSKNUCKLE				(1) | ||||||
|  | #define WEAPON_GOLFCLUB					(2) | ||||||
|  | #define WEAPON_NITESTICK				(3) | ||||||
|  | #define WEAPON_KNIFE					(4) | ||||||
|  | #define WEAPON_BAT						(5) | ||||||
|  | #define WEAPON_SHOVEL					(6) | ||||||
|  | #define WEAPON_POOLSTICK				(7) | ||||||
|  | #define WEAPON_KATANA					(8) | ||||||
|  | #define WEAPON_CHAINSAW					(9) | ||||||
|  | #define WEAPON_DILDO					(10) | ||||||
|  | #define WEAPON_DILDO2					(11) | ||||||
|  | #define WEAPON_VIBRATOR					(12) | ||||||
|  | #define WEAPON_VIBRATOR2				(13) | ||||||
|  | #define WEAPON_FLOWER					(14) | ||||||
|  | #define WEAPON_CANE						(15) | ||||||
|  | #define WEAPON_GRENADE					(16) | ||||||
|  | #define WEAPON_TEARGAS					(17) | ||||||
|  | #define WEAPON_MOLTOV					(18) | ||||||
|  | #define WEAPON_COLT45					(22) | ||||||
|  | #define WEAPON_SILENCED					(23) | ||||||
|  | #define WEAPON_DEAGLE					(24) | ||||||
|  | #define WEAPON_SHOTGUN					(25) | ||||||
|  | #define WEAPON_SAWEDOFF					(26) | ||||||
|  | #define WEAPON_SHOTGSPA					(27) | ||||||
|  | #define WEAPON_UZI						(28) | ||||||
|  | #define WEAPON_MP5						(29) | ||||||
|  | #define WEAPON_AK47						(30) | ||||||
|  | #define WEAPON_M4						(31) | ||||||
|  | #define WEAPON_TEC9						(32) | ||||||
|  | #define WEAPON_RIFLE					(33) | ||||||
|  | #define WEAPON_SNIPER					(34) | ||||||
|  | #define WEAPON_ROCKETLAUNCHER			(35) | ||||||
|  | #define WEAPON_HEATSEEKER				(36) | ||||||
|  | #define WEAPON_FLAMETHROWER				(37) | ||||||
|  | #define WEAPON_MINIGUN					(38) | ||||||
|  | #define WEAPON_SATCHEL					(39) | ||||||
|  | #define WEAPON_BOMB						(40) | ||||||
|  | #define WEAPON_SPRAYCAN					(41) | ||||||
|  | #define WEAPON_FIREEXTINGUISHER			(42) | ||||||
|  | #define WEAPON_CAMERA					(43) | ||||||
|  | #define WEAPON_PARACHUTE				(46) | ||||||
|  | #define WEAPON_VEHICLE					(49) | ||||||
|  | #define WEAPON_DROWN					(53) | ||||||
|  | #define WEAPON_COLLISION				(54) | ||||||
|  |  | ||||||
|  | // Keys | ||||||
|  | #define KEY_ACTION				(1) | ||||||
|  | #define KEY_CROUCH				(2) | ||||||
|  | #define KEY_FIRE				(4) | ||||||
|  | #define KEY_SPRINT				(8) | ||||||
|  | #define KEY_SECONDARY_ATTACK	(16) | ||||||
|  | #define KEY_JUMP				(32) | ||||||
|  | #define KEY_LOOK_RIGHT			(64) | ||||||
|  | #define KEY_HANDBRAKE			(128) | ||||||
|  | #define KEY_LOOK_LEFT			(256) | ||||||
|  | #define KEY_SUBMISSION			(512) | ||||||
|  | #define KEY_LOOK_BEHIND			(512) | ||||||
|  | #define KEY_WALK				(1024) | ||||||
|  | #define KEY_ANALOG_UP			(2048) | ||||||
|  | #define KEY_ANALOG_DOWN			(4096) | ||||||
|  | #define KEY_ANALOG_LEFT			(8192) | ||||||
|  | #define KEY_ANALOG_RIGHT		(16384) | ||||||
|  | #define KEY_YES					(65536) | ||||||
|  | #define KEY_NO					(131072) | ||||||
|  | #define KEY_CTRL_BACK			(262144) | ||||||
|  |  | ||||||
|  | #define KEY_UP					(-128) | ||||||
|  | #define KEY_DOWN				(128) | ||||||
|  | #define KEY_LEFT				(-128) | ||||||
|  | #define KEY_RIGHT				(128) | ||||||
|  |  | ||||||
|  | // -------------------------------------------------- | ||||||
|  | // Forwards (Callback declarations) | ||||||
|  | // -------------------------------------------------- | ||||||
|  |  | ||||||
|  | forward OnGameModeInit(); | ||||||
|  | forward OnGameModeExit(); | ||||||
|  | forward OnFilterScriptInit(); | ||||||
|  | forward OnFilterScriptExit(); | ||||||
|  | forward OnPlayerConnect(playerid); | ||||||
|  | forward OnPlayerDisconnect(playerid, reason); | ||||||
|  | forward OnPlayerSpawn(playerid); | ||||||
|  | forward OnPlayerDeath(playerid, killerid, reason); | ||||||
|  | forward OnVehicleSpawn(vehicleid); | ||||||
|  | forward OnVehicleDeath(vehicleid, killerid); | ||||||
|  | forward OnPlayerText(playerid, text[]); | ||||||
|  | forward OnPlayerCommandText(playerid, cmdtext[]); | ||||||
|  | forward OnPlayerRequestClass(playerid, classid); | ||||||
|  | forward OnPlayerEnterVehicle(playerid, vehicleid, ispassenger); | ||||||
|  | forward OnPlayerExitVehicle(playerid, vehicleid); | ||||||
|  | forward OnPlayerStateChange(playerid, newstate, oldstate); | ||||||
|  | forward OnPlayerEnterCheckpoint(playerid); | ||||||
|  | forward OnPlayerLeaveCheckpoint(playerid); | ||||||
|  | forward OnPlayerEnterRaceCheckpoint(playerid); | ||||||
|  | forward OnPlayerLeaveRaceCheckpoint(playerid); | ||||||
|  | forward OnRconCommand(cmd[]); | ||||||
|  | forward OnPlayerRequestSpawn(playerid); | ||||||
|  | forward OnObjectMoved(objectid); | ||||||
|  | forward OnPlayerObjectMoved(playerid, objectid); | ||||||
|  | forward OnPlayerPickUpPickup(playerid, pickupid); | ||||||
|  | forward OnVehicleMod(playerid, vehicleid, componentid); | ||||||
|  | forward OnEnterExitModShop(playerid, enterexit, interiorid); | ||||||
|  | forward OnVehiclePaintjob(playerid, vehicleid, paintjobid); | ||||||
|  | forward OnVehicleRespray(playerid, vehicleid, color1, color2); | ||||||
|  | forward OnVehicleDamageStatusUpdate(vehicleid, playerid); | ||||||
|  | forward OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat); | ||||||
|  | forward OnPlayerSelectedMenuRow(playerid, row); | ||||||
|  | forward OnPlayerExitedMenu(playerid); | ||||||
|  | forward OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid); | ||||||
|  | forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys); | ||||||
|  | forward OnRconLoginAttempt( ip[], password[], success ); | ||||||
|  | forward OnPlayerUpdate(playerid); | ||||||
|  | forward OnPlayerStreamIn(playerid, forplayerid); | ||||||
|  | forward OnPlayerStreamOut(playerid, forplayerid); | ||||||
|  | forward OnVehicleStreamIn(vehicleid, forplayerid); | ||||||
|  | forward OnVehicleStreamOut(vehicleid, forplayerid); | ||||||
|  | forward OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]); | ||||||
|  | forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid); | ||||||
|  | forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid); | ||||||
|  | forward OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ); | ||||||
|  | forward OnPlayerClickTextDraw(playerid, Text:clickedid); | ||||||
|  | forward OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid); | ||||||
|  |  | ||||||
|  | #define CLICK_SOURCE_SCOREBOARD		0 | ||||||
|  | forward OnPlayerClickPlayer(playerid, clickedplayerid, source); | ||||||
|  |  | ||||||
|  | #define EDIT_RESPONSE_CANCEL		0 | ||||||
|  | #define EDIT_RESPONSE_FINAL			1 | ||||||
|  | #define EDIT_RESPONSE_UPDATE		2 | ||||||
|  |  | ||||||
|  | forward OnPlayerEditObject( playerid, playerobject, objectid, response,  | ||||||
|  | Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ ); | ||||||
|  |  | ||||||
|  | forward OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid, | ||||||
|  | Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, | ||||||
|  | Float:fRotX, Float:fRotY, Float:fRotZ, | ||||||
|  | Float:fScaleX, Float:fScaleY, Float:fScaleZ ); | ||||||
|  |  | ||||||
|  | #define SELECT_OBJECT_GLOBAL_OBJECT	1 | ||||||
|  | #define SELECT_OBJECT_PLAYER_OBJECT 2 | ||||||
|  |  | ||||||
|  | forward OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ); | ||||||
|  |  | ||||||
|  | // -------------------------------------------------- | ||||||
							
								
								
									
										520
									
								
								samples/PAWN/grandlarc.pwn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										520
									
								
								samples/PAWN/grandlarc.pwn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,520 @@ | |||||||
|  | //---------------------------------------------------------- | ||||||
|  | // | ||||||
|  | // GRAND LARCENY 1.0 | ||||||
|  | // A freeroam gamemode for SA-MP 0.3 | ||||||
|  | // | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | #include <a_samp> | ||||||
|  | #include <core> | ||||||
|  | #include <float> | ||||||
|  | #include "../include/gl_common.inc" | ||||||
|  | #include "../include/gl_spawns.inc" | ||||||
|  |  | ||||||
|  | #pragma tabsize 0 | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | #define COLOR_WHITE                 0xFFFFFFFF | ||||||
|  | #define COLOR_NORMAL_PLAYER 0xFFBB7777 | ||||||
|  |  | ||||||
|  | #define CITY_LOS_SANTOS         0 | ||||||
|  | #define CITY_SAN_FIERRO         1 | ||||||
|  | #define CITY_LAS_VENTURAS         2 | ||||||
|  |  | ||||||
|  | new total_vehicles_from_files=0; | ||||||
|  |  | ||||||
|  | // Class selection globals | ||||||
|  | new gPlayerCitySelection[MAX_PLAYERS]; | ||||||
|  | new gPlayerHasCitySelected[MAX_PLAYERS]; | ||||||
|  | new gPlayerLastCitySelectionTick[MAX_PLAYERS]; | ||||||
|  |  | ||||||
|  | new Text:txtClassSelHelper; | ||||||
|  | new Text:txtLosSantos; | ||||||
|  | new Text:txtSanFierro; | ||||||
|  | new Text:txtLasVenturas; | ||||||
|  |  | ||||||
|  | new thisanimid=0; | ||||||
|  | new lastanimid=0; | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | main() | ||||||
|  | { | ||||||
|  |         print("\n---------------------------------------"); | ||||||
|  |         print("Running Grand Larceny - by the SA-MP team\n"); | ||||||
|  |         print("---------------------------------------\n"); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | public OnPlayerConnect(playerid) | ||||||
|  | { | ||||||
|  |         GameTextForPlayer(playerid,"~w~Grand Larceny",3000,4); | ||||||
|  |           SendClientMessage(playerid,COLOR_WHITE,"Welcome to {88AA88}G{FFFFFF}rand {88AA88}L{FFFFFF}arceny"); | ||||||
|  |            | ||||||
|  |           // class selection init vars | ||||||
|  |           gPlayerCitySelection[playerid] = -1; | ||||||
|  |         gPlayerHasCitySelected[playerid] = 0; | ||||||
|  |         gPlayerLastCitySelectionTick[playerid] = GetTickCount(); | ||||||
|  |  | ||||||
|  |         //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER); | ||||||
|  |  | ||||||
|  |         //Kick(playerid); | ||||||
|  |          | ||||||
|  |         /* | ||||||
|  |         Removes vending machines | ||||||
|  |         RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0); | ||||||
|  |         RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0); | ||||||
|  |         RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0); | ||||||
|  |         RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0); | ||||||
|  |         RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0); | ||||||
|  |         */ | ||||||
|  |          | ||||||
|  |         /* | ||||||
|  |         new ClientVersion[32]; | ||||||
|  |         GetPlayerVersion(playerid, ClientVersion, 32); | ||||||
|  |         printf("Player %d reports client version: %s", playerid, ClientVersion);*/ | ||||||
|  |  | ||||||
|  |          return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | public OnPlayerSpawn(playerid) | ||||||
|  | { | ||||||
|  |         if(IsPlayerNPC(playerid)) return 1; | ||||||
|  |          | ||||||
|  |         new randSpawn = 0; | ||||||
|  |          | ||||||
|  |         SetPlayerInterior(playerid,0); | ||||||
|  |         TogglePlayerClock(playerid,0); | ||||||
|  |          ResetPlayerMoney(playerid); | ||||||
|  |         GivePlayerMoney(playerid, 30000); | ||||||
|  |  | ||||||
|  |         if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) { | ||||||
|  |           randSpawn = random(sizeof(gRandomSpawns_LosSantos)); | ||||||
|  |           SetPlayerPos(playerid, | ||||||
|  |                  gRandomSpawns_LosSantos[randSpawn][0], | ||||||
|  |                  gRandomSpawns_LosSantos[randSpawn][1], | ||||||
|  |                  gRandomSpawns_LosSantos[randSpawn][2]); | ||||||
|  |                 SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]); | ||||||
|  |         } | ||||||
|  |         else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) { | ||||||
|  |           randSpawn = random(sizeof(gRandomSpawns_SanFierro)); | ||||||
|  |           SetPlayerPos(playerid, | ||||||
|  |                  gRandomSpawns_SanFierro[randSpawn][0], | ||||||
|  |                  gRandomSpawns_SanFierro[randSpawn][1], | ||||||
|  |                  gRandomSpawns_SanFierro[randSpawn][2]); | ||||||
|  |                 SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]); | ||||||
|  |         } | ||||||
|  |         else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) { | ||||||
|  |           randSpawn = random(sizeof(gRandomSpawns_LasVenturas)); | ||||||
|  |           SetPlayerPos(playerid, | ||||||
|  |                  gRandomSpawns_LasVenturas[randSpawn][0], | ||||||
|  |                  gRandomSpawns_LasVenturas[randSpawn][1], | ||||||
|  |                  gRandomSpawns_LasVenturas[randSpawn][2]); | ||||||
|  |                 SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER); | ||||||
|  |          | ||||||
|  |         SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200); | ||||||
|  |     SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200); | ||||||
|  |      | ||||||
|  |     GivePlayerWeapon(playerid,WEAPON_COLT45,100); | ||||||
|  |         //GivePlayerWeapon(playerid,WEAPON_MP5,100); | ||||||
|  |         TogglePlayerClock(playerid, 0); | ||||||
|  |  | ||||||
|  |         return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | public OnPlayerDeath(playerid, killerid, reason) | ||||||
|  | { | ||||||
|  |     new playercash; | ||||||
|  |      | ||||||
|  |     // if they ever return to class selection make them city | ||||||
|  |         // select again first | ||||||
|  |         gPlayerHasCitySelected[playerid] = 0; | ||||||
|  |      | ||||||
|  |         if(killerid == INVALID_PLAYER_ID) { | ||||||
|  |         ResetPlayerMoney(playerid); | ||||||
|  |         } else { | ||||||
|  |                 playercash = GetPlayerMoney(playerid); | ||||||
|  |                 if(playercash > 0) { | ||||||
|  |                         GivePlayerMoney(killerid, playercash); | ||||||
|  |                         ResetPlayerMoney(playerid); | ||||||
|  |                 } | ||||||
|  |         } | ||||||
|  |            return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | ClassSel_SetupCharSelection(playerid) | ||||||
|  | { | ||||||
|  |            if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) { | ||||||
|  |                 SetPlayerInterior(playerid,11); | ||||||
|  |                 SetPlayerPos(playerid,508.7362,-87.4335,998.9609); | ||||||
|  |                 SetPlayerFacingAngle(playerid,0.0); | ||||||
|  |             SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609); | ||||||
|  |                 SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609); | ||||||
|  |         } | ||||||
|  |         else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) { | ||||||
|  |                 SetPlayerInterior(playerid,3); | ||||||
|  |                 SetPlayerPos(playerid,-2673.8381,1399.7424,918.3516); | ||||||
|  |                 SetPlayerFacingAngle(playerid,181.0); | ||||||
|  |             SetPlayerCameraPos(playerid,-2673.2776,1394.3859,918.3516); | ||||||
|  |                 SetPlayerCameraLookAt(playerid,-2673.8381,1399.7424,918.3516); | ||||||
|  |         } | ||||||
|  |         else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) { | ||||||
|  |                 SetPlayerInterior(playerid,3); | ||||||
|  |                 SetPlayerPos(playerid,349.0453,193.2271,1014.1797); | ||||||
|  |                 SetPlayerFacingAngle(playerid,286.25); | ||||||
|  |             SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875); | ||||||
|  |                 SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797); | ||||||
|  |         } | ||||||
|  |          | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  | // Used to init textdraws of city names | ||||||
|  |  | ||||||
|  | ClassSel_InitCityNameText(Text:txtInit) | ||||||
|  | { | ||||||
|  |           TextDrawUseBox(txtInit, 0); | ||||||
|  |         TextDrawLetterSize(txtInit,1.25,3.0); | ||||||
|  |         TextDrawFont(txtInit, 0); | ||||||
|  |         TextDrawSetShadow(txtInit,0); | ||||||
|  |     TextDrawSetOutline(txtInit,1); | ||||||
|  |     TextDrawColor(txtInit,0xEEEEEEFF); | ||||||
|  |     TextDrawBackgroundColor(txtClassSelHelper,0x000000FF); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | ClassSel_InitTextDraws() | ||||||
|  | { | ||||||
|  |     // Init our observer helper text display | ||||||
|  |         txtLosSantos = TextDrawCreate(10.0, 380.0, "Los Santos"); | ||||||
|  |         ClassSel_InitCityNameText(txtLosSantos); | ||||||
|  |         txtSanFierro = TextDrawCreate(10.0, 380.0, "San Fierro"); | ||||||
|  |         ClassSel_InitCityNameText(txtSanFierro); | ||||||
|  |         txtLasVenturas = TextDrawCreate(10.0, 380.0, "Las Venturas"); | ||||||
|  |         ClassSel_InitCityNameText(txtLasVenturas); | ||||||
|  |  | ||||||
|  |     // Init our observer helper text display | ||||||
|  |         txtClassSelHelper = TextDrawCreate(10.0, 415.0, | ||||||
|  |          " Press ~b~~k~~GO_LEFT~ ~w~or ~b~~k~~GO_RIGHT~ ~w~to switch cities.~n~ Press ~r~~k~~PED_FIREWEAPON~ ~w~to select."); | ||||||
|  |         TextDrawUseBox(txtClassSelHelper, 1); | ||||||
|  |         TextDrawBoxColor(txtClassSelHelper,0x222222BB); | ||||||
|  |         TextDrawLetterSize(txtClassSelHelper,0.3,1.0); | ||||||
|  |         TextDrawTextSize(txtClassSelHelper,400.0,40.0); | ||||||
|  |         TextDrawFont(txtClassSelHelper, 2); | ||||||
|  |         TextDrawSetShadow(txtClassSelHelper,0); | ||||||
|  |     TextDrawSetOutline(txtClassSelHelper,1); | ||||||
|  |     TextDrawBackgroundColor(txtClassSelHelper,0x000000FF); | ||||||
|  |     TextDrawColor(txtClassSelHelper,0xFFFFFFFF); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | ClassSel_SetupSelectedCity(playerid) | ||||||
|  | { | ||||||
|  |         if(gPlayerCitySelection[playerid] == -1) { | ||||||
|  |                 gPlayerCitySelection[playerid] = CITY_LOS_SANTOS; | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) { | ||||||
|  |                 SetPlayerInterior(playerid,0); | ||||||
|  |                    SetPlayerCameraPos(playerid,1630.6136,-2286.0298,110.0); | ||||||
|  |                 SetPlayerCameraLookAt(playerid,1887.6034,-1682.1442,47.6167); | ||||||
|  |                  | ||||||
|  |                 TextDrawShowForPlayer(playerid,txtLosSantos); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtSanFierro); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtLasVenturas); | ||||||
|  |         } | ||||||
|  |         else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) { | ||||||
|  |                 SetPlayerInterior(playerid,0); | ||||||
|  |                    SetPlayerCameraPos(playerid,-1300.8754,68.0546,129.4823); | ||||||
|  |                 SetPlayerCameraLookAt(playerid,-1817.9412,769.3878,132.6589); | ||||||
|  |                  | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtLosSantos); | ||||||
|  |                 TextDrawShowForPlayer(playerid,txtSanFierro); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtLasVenturas); | ||||||
|  |         } | ||||||
|  |         else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) { | ||||||
|  |                 SetPlayerInterior(playerid,0); | ||||||
|  |                    SetPlayerCameraPos(playerid,1310.6155,1675.9182,110.7390); | ||||||
|  |                 SetPlayerCameraLookAt(playerid,2285.2944,1919.3756,68.2275); | ||||||
|  |                  | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtLosSantos); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtSanFierro); | ||||||
|  |                 TextDrawShowForPlayer(playerid,txtLasVenturas); | ||||||
|  |         } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | ClassSel_SwitchToNextCity(playerid) | ||||||
|  | { | ||||||
|  |     gPlayerCitySelection[playerid]++; | ||||||
|  |         if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) { | ||||||
|  |          gPlayerCitySelection[playerid] = CITY_LOS_SANTOS; | ||||||
|  |         } | ||||||
|  |         PlayerPlaySound(playerid,1052,0.0,0.0,0.0); | ||||||
|  |         gPlayerLastCitySelectionTick[playerid] = GetTickCount(); | ||||||
|  |         ClassSel_SetupSelectedCity(playerid); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | ClassSel_SwitchToPreviousCity(playerid) | ||||||
|  | { | ||||||
|  |     gPlayerCitySelection[playerid]--; | ||||||
|  |         if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) { | ||||||
|  |          gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS; | ||||||
|  |         } | ||||||
|  |         PlayerPlaySound(playerid,1053,0.0,0.0,0.0); | ||||||
|  |         gPlayerLastCitySelectionTick[playerid] = GetTickCount(); | ||||||
|  |         ClassSel_SetupSelectedCity(playerid); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | ClassSel_HandleCitySelection(playerid) | ||||||
|  | { | ||||||
|  |         new Keys,ud,lr; | ||||||
|  |     GetPlayerKeys(playerid,Keys,ud,lr); | ||||||
|  |      | ||||||
|  |     if(gPlayerCitySelection[playerid] == -1) { | ||||||
|  |                 ClassSel_SwitchToNextCity(playerid); | ||||||
|  |                 return; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         // only allow new selection every ~500 ms | ||||||
|  |         if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return; | ||||||
|  |          | ||||||
|  |         if(Keys & KEY_FIRE) { | ||||||
|  |          gPlayerHasCitySelected[playerid] = 1; | ||||||
|  |          TextDrawHideForPlayer(playerid,txtClassSelHelper); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtLosSantos); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtSanFierro); | ||||||
|  |                 TextDrawHideForPlayer(playerid,txtLasVenturas); | ||||||
|  |          TogglePlayerSpectating(playerid,0); | ||||||
|  |          return; | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         if(lr > 0) { | ||||||
|  |          ClassSel_SwitchToNextCity(playerid); | ||||||
|  |         } | ||||||
|  |         else if(lr < 0) { | ||||||
|  |          ClassSel_SwitchToPreviousCity(playerid); | ||||||
|  |         } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | public OnPlayerRequestClass(playerid, classid) | ||||||
|  | { | ||||||
|  |         if(IsPlayerNPC(playerid)) return 1; | ||||||
|  |  | ||||||
|  |         if(gPlayerHasCitySelected[playerid]) { | ||||||
|  |                 ClassSel_SetupCharSelection(playerid); | ||||||
|  |                 return 1; | ||||||
|  |         } else { | ||||||
|  |                 if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) { | ||||||
|  |                         TogglePlayerSpectating(playerid,1); | ||||||
|  |                     TextDrawShowForPlayer(playerid, txtClassSelHelper); | ||||||
|  |                     gPlayerCitySelection[playerid] = -1; | ||||||
|  |                 } | ||||||
|  |           } | ||||||
|  |      | ||||||
|  |         return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | public OnGameModeInit() | ||||||
|  | { | ||||||
|  |         SetGameModeText("Grand Larceny"); | ||||||
|  |         ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL); | ||||||
|  |         ShowNameTags(1); | ||||||
|  |         SetNameTagDrawDistance(40.0); | ||||||
|  |         EnableStuntBonusForAll(0); | ||||||
|  |         DisableInteriorEnterExits(); | ||||||
|  |         SetWeather(2); | ||||||
|  |         SetWorldTime(11); | ||||||
|  |  | ||||||
|  |         //UsePlayerPedAnims(); | ||||||
|  |         //ManualVehicleEngineAndLights(); | ||||||
|  |         //LimitGlobalChatRadius(300.0); | ||||||
|  |          | ||||||
|  |         ClassSel_InitTextDraws(); | ||||||
|  |  | ||||||
|  |         // Player Class | ||||||
|  |         AddPlayerClass(281,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(282,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(283,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(284,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(285,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(286,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(287,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(288,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(265,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(266,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(267,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(268,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(269,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(270,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(1,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(2,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(3,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(4,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(5,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(6,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(8,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(42,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(65,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         //AddPlayerClass(74,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(86,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(119,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |          AddPlayerClass(149,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(208,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(273,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |          | ||||||
|  |         AddPlayerClass(47,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(48,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(49,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(50,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(51,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(52,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(53,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(54,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(55,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(56,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(57,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(58,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |            AddPlayerClass(68,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(69,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(70,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(71,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(72,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(73,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(75,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(76,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(78,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(79,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(80,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(81,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(82,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(83,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(84,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(85,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(87,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(88,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(89,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(91,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(92,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(93,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(95,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(96,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(97,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(98,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |         AddPlayerClass(99,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1); | ||||||
|  |  | ||||||
|  |         // SPECIAL | ||||||
|  |         total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt"); | ||||||
|  |         total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt"); | ||||||
|  |  | ||||||
|  |            // LAS VENTURAS | ||||||
|  |      total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt"); | ||||||
|  |      | ||||||
|  |     // SAN FIERRO | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt"); | ||||||
|  |      | ||||||
|  |     // LOS SANTOS | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt"); | ||||||
|  |      | ||||||
|  |     // OTHER AREAS | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt"); | ||||||
|  |     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt"); | ||||||
|  |  | ||||||
|  |     printf("Total vehicles from files: %d",total_vehicles_from_files); | ||||||
|  |  | ||||||
|  |         return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
|  |  | ||||||
|  | public OnPlayerUpdate(playerid) | ||||||
|  | { | ||||||
|  |         if(!IsPlayerConnected(playerid)) return 0; | ||||||
|  |         if(IsPlayerNPC(playerid)) return 1; | ||||||
|  |  | ||||||
|  |         // changing cities by inputs | ||||||
|  |         if( !gPlayerHasCitySelected[playerid] && | ||||||
|  |          GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) { | ||||||
|  |          ClassSel_HandleCitySelection(playerid); | ||||||
|  |          return 1; | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         // No weapons in interiors | ||||||
|  |         if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) { | ||||||
|  |          SetPlayerArmedWeapon(playerid,0); // fists | ||||||
|  |          return 0; // no syncing until they change their weapon | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         // Don't allow minigun | ||||||
|  |         if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) { | ||||||
|  |          Kick(playerid); | ||||||
|  |          return 0; | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         /* No jetpacks allowed | ||||||
|  |         if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) { | ||||||
|  |          Kick(playerid); | ||||||
|  |          return 0; | ||||||
|  |         }*/ | ||||||
|  |  | ||||||
|  |         /* For testing animations | ||||||
|  |     new msg[128+1]; | ||||||
|  |         new animlib[32+1]; | ||||||
|  |         new animname[32+1]; | ||||||
|  |  | ||||||
|  |         thisanimid = GetPlayerAnimationIndex(playerid); | ||||||
|  |         if(lastanimid != thisanimid) | ||||||
|  |         { | ||||||
|  |                 GetAnimationName(thisanimid,animlib,32,animname,32); | ||||||
|  |                 format(msg, 128, "anim(%d,%d): %s %s", lastanimid, thisanimid, animlib, animname); | ||||||
|  |                 lastanimid = thisanimid; | ||||||
|  |                 SendClientMessage(playerid, 0xFFFFFFFF, msg); | ||||||
|  |         }*/ | ||||||
|  |  | ||||||
|  |         return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | //---------------------------------------------------------- | ||||||
		Reference in New Issue
	
	Block a user