zcmd, 1 CMD works, the other one dosen't - FS
#1

So, it compiles without any errors, zcmd is included, nothing is written in OnPlayerCommandText, the FS is reloaded.

This command works:
pawn Код:
CMD:ison(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, COLOR_GREEN, "Yes.");
    }
    return 1;
}
This command dosent:
pawn Код:
CMD:jetpack(playerid, params[]) // Have also tried /jetpack1
{
    new targetid;
    if(IsPlayerAdmin(playerid))
    if(sscanf(params,"u", targetid)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /jetpack [ID/PartOfName]");
    {
        GivePlayerWeapon(targetid, 21, 0); // have also tried with 1 ammo. Note: This is the jetpack.
    }
    return 1;
}
What happens with this command is that if i write /jetpack it says "USAGE: /jetpack [ID/PartOfName]", but if i type
my ID, i dont get the jetpack.

What's wrong ?
Reply
#2

pawn Код:
CMD:jetpack(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED, "ERROR: Only administrators can use this command.");
    new targetid;    
    if(sscanf(params,"u", targetid)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /jetpack [ID/PartOfName]");
    SetPlayerSpecialAction(targetid, SPECIAL_ACTION_USEJETPACK);
    return 1;
}
Jet pack is not a weapon. It's special action.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)