SA-MP Forums Archive
zcmd, 1 CMD works, the other one dosen't - FS - 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: zcmd, 1 CMD works, the other one dosen't - FS (/showthread.php?tid=457734)



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

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 ?


Re: zcmd, 1 CMD works, the other one dosen't - FS - RedJohn - 12.08.2013

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.