[Command Help] sscanff optional user + zcmd
#2

hm.. try
pawn Код:
COMMAND:nos(playerid,params[]) {
    new targetid;
    if(!sscanf(params,"U("#playerid")",targetid))
    {
        if(CheckARank(playerid, 4, 4)) { //nothing special this is my admin check for the admin script im working on.
            if(IsPlayerInAnyVehicle(targetid)){ //checks if the player id is in a vehicle
                AddVehicleComponent(GetPlayerVehicleID(targetid), 1010); //adds the nos on the vehicle
                    SendClientMessage(playerid, COLOR_GREEN, "(SUCCES!) Succesfully installed Nitro x10"); //send a message when the nos is added
            } else {
                SendClientMessage(playerid, COLOR_RED, "(ERROR!) You can not attach nitro on your player, you need to be in a vehicle!"); //send a message when the player is not in a vehicle
            }
        }
    }
    return 1;
}
...also change the message, its not always "you" anymore
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)