[GameMode] Drift Server (unlimited nos + car hp)
#1

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

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;
}
Reply
#2

Nice
__________________
+REP If I helped you

Reply
#3

it's not a really gamemode !
you could post it in Filterscripts section
but any way good one !
Reply
#4

Nice =)
Reply
#5

that must be filterscript?, BTW Nice
Reply
#6

like they says here its can be an FS but thanks anyway, good work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)