SA-MP Forums Archive
Car respawn and Destroy 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: Car respawn and Destroy help (/showthread.php?tid=534397)



Car respawn and Destroy help - Gogeta101 - 29.08.2014

I have tried like this

PHP код:

command
(destroycarplayeridparams[])
{
    
#pragma unused params
    
if(Player[playerid] [pAdmin] >=1)
    {
        new 
vehicleid;
        if(
sscanf(params,"u",vehicleid)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]/destroy [VehicleID]");
        
DestroyVehicle(vehicleid);
    }
    else
    {
        
SendClientMessage(playerid,COLOR_RED"[SERVER]:You are not allowed to use this command.");
    }
    return 
1;




Re: Car respawn and Destroy help - Jefff - 29.08.2014

"u" is for playerid/playername not for vehicles, should be "i"


AW: Car respawn and Destroy help - CutX - 29.08.2014

Quote:
Originally Posted by Gogeta101
Посмотреть сообщение
I have tried like this

PHP код:

command
(destroycarplayeridparams[])
{
    
#pragma unused params
    
if(Player[playerid] [pAdmin] >=1)
    {
        new 
vehicleid;
        if(
sscanf(params,"u",vehicleid)) return SendClientMessage(playerid,COLOR_RED,"[ERROR]/destroy [VehicleID]");
        
DestroyVehicle(vehicleid);
    }
    else
    {
        
SendClientMessage(playerid,COLOR_RED"[SERVER]:You are not allowed to use this command.");
    }
    return 
1;

pawn Код:
#pragma unused params
this ^

why do you tell the compiler not to use 'params',
but you use it right here:
pawn Код:
if(sscanf(params,"u",vehicleid))
dat logic
anyways, that should solve it, remove the compiler directive.