Get in Player Vehicle [PROBLEM]
#1

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)