Get in Player Vehicle [PROBLEM] - 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: Get in Player Vehicle [PROBLEM] (
/showthread.php?tid=497843)
Get in Player Vehicle [PROBLEM] -
AwokenNeoX - 28.02.2014
This is my Command to get in a Player Vehicle. But he show me the command is unkown
Код:
Code:
dcmd_giv(playerid,params[])
{
#pragma unused params
if(AccInfo[playerid][Level] >= 3)
{
new targetid;
if( sscanf( params, "u", targetid ) ) return SendClientMessage( playerid, -1, "Usage: /giv [playerid]" );
if( targetid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, "Invalid playerid!" );
if( !IsPlayerInAnyVehicle( targetid ) ) return SendClientMessage( playerid, -1, "This player has no vehicle!" );
RemovePlayerFromVehicle( targetid );
PutPlayerInVehicle( playerid, GetPlayerVehicleID( targetid ), 0 );
return 1;
}
}
Re: Get in Player Vehicle [PROBLEM] -
Smileys - 28.02.2014
use ZCMD, lol.
dcmd is very old, slow and unefficient.
ZCMD is much easier, and much faster.
https://sampforum.blast.hk/showthread.php?tid=91354
anyway, in your code you do
#pragma unused params
while it's used in the code below, which I gave you before, as you can see it does
if( sscanf( params
which means it uses the params.
remove the following line:
#pragma unused params
anyway I highly suggest you to use ZCMD.