SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/09/2012, 08:12 AM   #1
CrazyChoco
Gangsta
 
Join Date: Feb 2012
Posts: 896
Reputation: 35
Default Cmd Dosn't working

Hai, i've got my cmd here

pawn Code:
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?
CrazyChoco is offline   Reply With Quote
Old 18/09/2012, 08:23 AM   #2
CrazyChoco
Gangsta
 
Join Date: Feb 2012
Posts: 896
Reputation: 35
Default Re: Cmd Dosn't working

Is it something which is done in mistake, typos to fix this issue?
CrazyChoco is offline   Reply With Quote
Old 18/09/2012, 08:30 AM   #3
XtremeR
Gangsta
 
XtremeR's Avatar
 
Join Date: Aug 2012
Location: Australia
Posts: 867
Reputation: 565
Default Re: Cmd Dosn't working

well.. look at top of the script and see i think you have defined zcmd or any else
__________________
XtremeR is offline   Reply With Quote
Old 18/09/2012, 11:47 AM   #4
CrazyChoco
Gangsta
 
Join Date: Feb 2012
Posts: 896
Reputation: 35
Default Re: Cmd Dosn't working

i havn't
CrazyChoco is offline   Reply With Quote
Old 18/09/2012, 12:03 PM   #5
mamorunl
High-roller
 
mamorunl's Avatar
 
Join Date: Feb 2007
Location: Groningen/Netherlands
Posts: 1,939
Reputation: 2246
Default Re: Cmd Dosn't working

Quote:
Originally Posted by XtremeR View Post
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.
mamorunl is offline   Reply With Quote
Old 18/09/2012, 12:26 PM   #6
CrazyChoco
Gangsta
 
Join Date: Feb 2012
Posts: 896
Reputation: 35
Default Re: Cmd Dosn't working

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.
CrazyChoco is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NPC Dosn't Connect Passout Scripting Help 1 03/12/2011 09:02 AM
Dialog dosn't respond !! sbulletin Help Archive 3 06/10/2010 04:32 PM
Variables. += Dosn't work. Ernis456 Help Archive 12 21/08/2010 04:43 AM
Map Script dosn't work.. Negrosoo Help Archive 3 25/06/2009 08:05 PM
Why dosn't this work? FreddeN Help Archive 3 23/05/2009 05:49 PM


All times are GMT. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.