04.04.2014, 21:17
Not really alot of work but I've been getting plenty of requests from friends without alot of scripting knowledge to have the script and since it's only like 50 lines I guess I don't really mind giving it out. It has player and vehicle godmode and also unlimited nos (applied when holding mouse button). A Elegy can be spawned using /car. It should probably be filed as a filterscript but whatever.
Credits: SA-MP wiki and Basicz
Credits: SA-MP wiki and Basicz
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
main ();
public OnPlayerSpawn( playerid )
{
new
randskin = 1 + random ( 298 ); // random skin
SetPlayerPos ( playerid, 1679.1, -1752.7, 13.5 );
SetPlayerSkin ( playerid, randskin );
return 1;
}
public OnPlayerUpdate( playerid )
{
new Float: health;
if ( IsPlayerInAnyVehicle ( playerid ) )
RepairVehicle ( GetPlayerVehicleID (playerid ) );
if( GetPlayerHealth ( playerid, health ) < 100 )
SetPlayerHealth ( playerid, 100.0 );
return 1;
}
public OnPlayerKeyStateChange ( playerid, newkeys, oldkeys )
{
if ( HOLDING( KEY_FIRE ) && GetPlayerState ( playerid ) == PLAYER_STATE_DRIVER )
AddVehicleComponent ( GetPlayerVehicleID ( playerid ), 1010 );
if ( RELEASED( KEY_FIRE ) && GetPlayerState ( playerid ) == PLAYER_STATE_DRIVER )
RemoveVehicleComponent ( GetPlayerVehicleID ( playerid ), 1010 );
return 1;
}
CMD:car ( playerid, params[] )
{
new
Float:x, Float:y, Float:z, Float:a, spawnedcar;
GetPlayerPos ( playerid, x, y, z ), GetPlayerFacingAngle( playerid, a );
spawnedcar = CreateVehicle ( 562, x, y, z, a, -1, -1, -1 );
PutPlayerInVehicle ( playerid, spawnedcar, 0 ) ;
SendClientMessage ( playerid, -1, "Spawned an Elegy at your location!" );
return 1;
}