Car respawn and Destroy help
#1

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;

Reply
#2

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)