SA-MP Forums Archive
command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: command help (/showthread.php?tid=285686)



command help - trapstar2020 - 25.09.2011

it there a possible way i can make command for a car to added not sure what to put so player can do it any help

eg
/bullet
spawns a bullet


Re: command help - Kitten - 25.09.2011

add this into your command
pawn Код:
new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,Float:x,Float:y,Float:z);
    new car1[MAX_PLAYERS];
    car1[playerid] = CreateVehicle(541,Float:x,Float:y,Float:z,100.0,1,1,10);
    PutPlayerInVehicle(playerid,car1[playerid],0);



Re: command help - .:Kaos:. - 25.09.2011

You can always use the command from fsdebug.
Код:
/v [vehiclename/id]



Re: command help - aRoach - 25.09.2011

Quote:
Originally Posted by Kitten
Посмотреть сообщение
add this into your command
pawn Код:
new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,Float:x,Float:y,Float:z);
    new car1[MAX_PLAYERS];
    car1[playerid] = CreateVehicle(541,Float:x,Float:y,Float:z,100.0,1,1,10);
    PutPlayerInVehicle(playerid,car1[playerid],0);
PWNED !

trapstar, Just do:
pawn Код:
// In top of your Script
new BULLET[ MAX_PLAYERS ];

// The Command
CMD:bullet( playerid )
{
    new Float: Pos[ 4 ];
    GetPlayerPos( playerid, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
    GetPlayerFacingAngle( playerid, Pos[ 3 ] );
    if( BULLET[ playerid ] > 0 )
    {
        if( GetPlayerVehicleID( playerid ) == BULLET[ playerid ] ) return SendClientMessage( playerid, info, "You are already sitting on your personal {FFFFFF}Bullet{4077F7}!" );
        if( IsPlayerInAnyVehicle( playerid ) ) RemovePlayerFromVehicle( playerid );
        LinkVehicleToInterior( BULLET[ playerid ], GetPlayerInterior( playerid ) );
        SetVehicleVirtualWorld( BULLET[ playerid ], GetPlayerVirtualWorld( playerid ) );
        PutPlayerInVehicle( playerid, BULLET[ playerid ], 0 );
        SetVehiclePos( BULLET[ playerid ], Pos[ 0 ], Pos[ 1 ], Pos[ 2 ] );
        SetVehicleZAngle( BULLET[ playerid ], Pos[ 3 ] );
        SendClientMessage( playerid, info, "Personal {FFFFFF}Bullet {4077F7}called!" );
    }
    else
    {
        if( IsPlayerInAnyVehicle( playerid ) ) RemovePlayerFromVehicle( playerid );
        BULLET[ playerid ] = CreateVehicle( 522, Pos[ 0 ], Pos[ 1 ], Pos[ 2 ], Pos[ 3 ], 75, 3, 240 );
        LinkVehicleToInterior( BULLET[ playerid ], GetPlayerInterior( playerid ) );
        SetVehicleVirtualWorld( BULLET[ playerid ], GetPlayerVirtualWorld( playerid ) );
        PutPlayerInVehicle( playerid, BULLET[ playerid ], 0 );
        SendClientMessage( playerid, info, "Personal {FFFFFF}Bullet {4077F7}created!" );
        foreach(Player, i)if( IsPlayerConnected( i ) && i != playerid ) SetVehicleParamsForPlayer( BULLET[ playerid ], i, 0, 1 );
    }
    return ( 1 );
}
And now the command create a Bullet Per Player, Oh yeah... Put:
pawn Код:
DestroyVehicle( BULLET[ playerid ] );
At OnPlayerDisconnect...