PDA

View Full Version : Cmd keeps comming


CrazyChoco
13/06/2012, 07:16 PM
hello im trying to add a /makearmy (id)
but when i try to type in-game it says Unknow Command but the text there shall be will show up but will come unknow command after and i wont receive the army status: My 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 {94ed40}%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;
}


Please help :D

reh_007
13/06/2012, 07:19 PM
Hey, Man. It's me Reh from vodkas.

CrazyChoco
13/06/2012, 07:21 PM
Hai Reh :D, i still need some help xD

reh_007
13/06/2012, 07:23 PM
You get any errors while compiling?

CrazyChoco
13/06/2012, 07:23 PM
nope, no errors

reh_007
13/06/2012, 07:25 PM
Add me, I can maybe Help :D

On skype: Reh_007

CrazyChoco
13/06/2012, 08:53 PM
I will, anyone else ??

mincer1667
13/06/2012, 08:59 PM
maybe you are returning something else before this command