You can can't use this command ?!!
#1

I have this command
PHP код:
CMD:car(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playeridCOLOR_RED"You can't use this command");
    new 
caridcolor1color2;
    new 
Float:xFloat:yFloat:z;
    new 
Float:health;
    if(
sscanf(params"ddd"caridcolor1color2)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /car [id] (Color 1) (Color 2)");
    if(
carid 411 || carid 611) return SendClientMessage(playeridCOLOR_RED"Car id can't be less than 411 or more than 611");
    
GetPlayerPos(playeridxyz);
    new 
car CreateVehicle(caridx+3yzcolor1color2, -1);
    new 
interior GetPlayerInterior(playerid);
    
LinkVehicleToInterior(carinterior);
    new 
world GetPlayerVirtualWorld(playerid);
    
SetVehicleVirtualWorld(carworld);
    
GetVehicleHealth(carhealth);
    if(
health == 0)
    {
    
DestroyVehicle(car);
    }
    
SendClientMessage(playeridCOLOR_BROWN"Vehcile Spawned");
    return 
1;

And when i use it it give me "You can't use this command"
but when i see my admin level it is equal 5
so what ?
Reply
#2

That happens because it has a condition if it is level 2 or greater will return to the message, otherwise function, you must do the following, this will allow use to anyone with the variable administrator in 1 or more.

pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
Edit:
Quote:
Originally Posted by nezo2001
Посмотреть сообщение
lol i slept 5 hours only today
That ? Lol.
Reply
#3

lol i slept 5 hours only today
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)