SA-MP Forums Archive
Cmd Dosn't working - 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: Cmd Dosn't working (/showthread.php?tid=378532)



Cmd Dosn't working - CrazyChoco - 18.09.2012

Hai, i've got my cmd here

pawn Код:
if(strcmp(cmd, "/makearmy", true) == 0) // Gives a player army
    {
    if(PlayerAdminLevel[playerid] >= 4 && IsAdminLogged[playerid] == 0){
    SendClientMessage(playerid,COLOR_ERROR,"Please Login Into Your Mod/Admin Account! Use /adminlog");
    return 1;
    }
    if(ArmyCommander[playerid] == 1 || PlayerAdminLevel[playerid] >= 4)
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: {FFFFFF}/makearmy (id)");
    return 1;
    }
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: {FFFFFF}/makearmy (id) ID Must be a number");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) {
    format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    if(CanUseArmy[giveplayerid] == 1){
    format(string, sizeof(string), "ID (%d) is already an army member", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new sendername[MAX_PLAYER_NAME];
    new receivername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,sendername, 24);
    GetPlayerName(giveplayerid,receivername, 24);
    format(string, sizeof(string), "You Have Give {3399FF}%s(%d){33AA33} Army Right",receivername,giveplayerid);
    SendClientMessage(playerid, COLOR_GREEN, string);
    format(string, sizeof(string), "Army Right Has Been Given For You! Have Fun! Read /rules, /pc");
    SendClientMessage(giveplayerid, COLOR_GREEN, string);
    format(string, sizeof(string), "Server %s{FF7F50} %s(%d) Has Give %s(%d) Army Right",AdminRanks[PlayerAdminLevel[playerid]],sendername,playerid,receivername,giveplayerid);
    printf("%s",string);
    SendAdminsMessage(0xFF7F50AA,string);
    CanUseArmy[giveplayerid] =1;
    }
    return 1;
    }
and it compiles fine on my gm no warnings or erros, but when i try the cmd to give me army it says that i recived army ...

and then last "Unknown Command" and i wont get the rights either. Any Helps?


Re: Cmd Dosn't working - CrazyChoco - 18.09.2012

Is it something which is done in mistake, typos to fix this issue?


Re: Cmd Dosn't working - XtremeR - 18.09.2012

well.. look at top of the script and see i think you have defined zcmd or any else


Re: Cmd Dosn't working - CrazyChoco - 18.09.2012

i havn't


Re: Cmd Dosn't working - mamorunl - 18.09.2012

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
well.. look at top of the script and see i think you have defined zcmd or any else
Because strcmp needs zcmd? Weird fella..

@OP: Learn to indent, this code is unreadable.


Re: Cmd Dosn't working - CrazyChoco - 18.09.2012

Well, i sort of figured it out, by opening one of my backup's but yea thanks for the advise ill use it next time.