Cmds Problem!
#1

Hello, Can somebody help me my all cmds are bugged! totally! Please when i type any cmd it's shows me the Usage .. But when i write it properly still shows me how to use the cmd, rather then it should work! Please can somebody solve this problem?
Reply
#2

compile with the latest includes and plugins
Reply
#3

Show one of the bugged commands
Reply
#4

dcmd_rob(playerid,params[])
{
new string[128];
new ID;
if(sscanf(params, "u", ID))
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /rob (Player Name/ID)");
return 1;
}
if(ID == INVALID_PLAYER_ID)
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot rob them",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(gTeam[playerid] < 9)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
return 1;
}
if(gTeam[playerid] == TEAM_STUNT)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
return 1;
}
if(gTeam[ID] == TEAM_STUNT)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on stunters.");
return 1;
}
if(GetPlayerInterior(playerid) != 0)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot Rob someone while in an Interior");
return 1;
}
if(IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You have been frozen by a Server Administrator. You cannot use this command.");
return 1;
}
if(InAdminMode[ID] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on this player because they are in Administrator mode.");
return 1;
}
if(IsKidnapped[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You are kidnapped. You cannot use this command.");
return 1;
}
if(Away[playerid] == 1)
{
SendClientMessage(playerid, COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while you are in AFK.");
return 1;
}
if(Away[ID] == 1)
{
SendClientMessage(playerid, COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while he is in AFK.");
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) > 3)
{
format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to rob him.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(GetPlayerMoney(ID) >= 1000000)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}This player has 1 Million or more in their pocket, You can't Rob them.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while in a vehicle. Exit the vehicle first.");
return 1;
}
if(GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while they are in a vehicle. Get them to exit the vehicle first.");
return 1;
}
if(playerid == ID)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob yourself, how can you even manage that?");
return 1;
}
if(IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not spawned. You cannot rob dead people ..",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsFrozen[ID] == 1)
{
format(string,sizeof(string),"%s(%d) is frozen by a Server Administrator. You cannot rob them.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(IsCuffed[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while you are cuffed, how can you manage it ?");
return 1;
}
if(IsCuffed[ID] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while he is cuffed");
return 1;
}
if(HasRobbedRecently[playerid] >= 1)
{
format(string,sizeof(string),"You are tired from the last robbery , You must wait {FFFF00}%d {800000}seconds before robbing again.!",HasRobbedRecently[playerid]);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}

if(IsInBank[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't use this command while in the bank");

if(HasSecureWallet[ID] != 0)
{
SendClientMessage(playerid,COLOR_RED,"This player got wallet that saved him from robbery");
format(string,sizeof(string),"%s(%d) tried to rob you but your wallet saved you.",PlayerName(playerid),playerid);
SendClientMessage(ID,COLOR_DODGERBLUE,string);
HasSecureWallet[ID] -=1;
HasRobbedRecently[playerid] =180;
return 1;
}
if(GetPlayerMoney(ID) <= 0)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}That player has no money in their pockets. What would be the point in robbing them?");
return 1;
}
if(InDuel[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You are in a Duel you can't use this command.");
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) <= 3)
{
new mrand =random((10 * GetPlayerMoney(ID)) / 100);
format(string,sizeof(string),"(CRIME COMMITED) - You have robbed $%d from %s(%d).",mrand,PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_RED,string);
format(string,sizeof(string),"~n~~n~~n~~n~~y~YOU ROBBED~n~~w~$%d ~r~GAINED",mrand);
GameTextForPlayer(playerid,string,6000,3);
GivePlayerMoney(playerid,mrand);
IncreaseWantedLevel(playerid,4);
HasRobbedRecently[playerid] =60;
IncreasePlayerScore(playerid,2);

format(string,sizeof(string),"~n~~n~~n~~n~~y~YOU ARE ROBBED~n~~w~$%d ~r~LOST",mrand);
GameTextForPlayer(ID,string,6000,3);
GivePlayerMoney(ID,-mrand);

format(string,sizeof(string),"{FFA500}[ROBBERY] {FFFFFF}%s(%d) has robbed {00FF00}$%d {FFFFFF}from %s(%d).",PlayerName(playerid),playerid,mrand,Playe rName(ID),ID);
SendClientMessageToAll(COLOR_RED,string);

format(string,sizeof(string),"4[ROBBERY] %s(%d) has robbed $%d from %s(%d) ..",PlayerName(playerid),playerid,mrand,PlayerNam e(ID),ID);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
return 1;
}
here it is!
Reply
#5

PHP код:
dcmd_rob(playerid,params[])
{
new 
string[128];
new 
ID;
if(
sscanf(params"u"ID))
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /rob (Player Name/ID)");
return 
1;
}
if(
ID == INVALID_PLAYER_ID)
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot rob them",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 
1;
}
if(
IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You must be alive and spawned in order to be able to use this command.");
return 
1;
}
if(
gTeam[playerid] < 9)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
return 
1;
}
if(
gTeam[playerid] == TEAM_STUNT)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
return 
1;
}
if(
gTeam[ID] == TEAM_STUNT)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on stunters.");
return 
1;
}
if(
GetPlayerInterior(playerid) != 0)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot Rob someone while in an Interior");
return 
1;
}
if(
IsFrozen[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You have been frozen by a Server Administrator. You cannot use this command.");
return 
1;
}
if(
InAdminMode[ID] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on this player because they are in Administrator mode.");
return 
1;
}
if(
IsKidnapped[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You are kidnapped. You cannot use this command.");
return 
1;
}
if(
Away[playerid] == 1)
{
SendClientMessage(playeridCOLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while you are in AFK.");
return 
1;
}
if(
Away[ID] == 1)
{
SendClientMessage(playeridCOLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while he is in AFK.");
return 
1;
}
if(
GetDistanceBetweenPlayers(playerid,ID) > 3)
{
format(string,sizeof(string),"%s(%d) is too far away. You cannot reach him to rob him.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 
1;
}
if(
GetPlayerMoney(ID) >= 1000000)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}This player has 1 Million or more in their pocket, You can't Rob them.");
return 
1;
}
if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while in a vehicle. Exit the vehicle first.");
return 
1;
}
if(
GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while they are in a vehicle. Get them to exit the vehicle first.");
return 
1;
}
if(
playerid == ID)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob yourself, how can you even manage that?");
return 
1;
}
if(
IsSpawned[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not spawned. You cannot rob dead people ..",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 
1;
}
if(
IsFrozen[ID] == 1)
{
format(string,sizeof(string),"%s(%d) is frozen by a Server Administrator. You cannot rob them.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 
1;
}
if(
IsCuffed[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while you are cuffed, how can you manage it ?");
return 
1;
}
if(
IsCuffed[ID] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot rob someone while he is cuffed");
return 
1;
}
if(
HasRobbedRecently[playerid] >= 1)
{
format(string,sizeof(string),"You are tired from the last robbery , You must wait {FFFF00}%d {800000}seconds before robbing again.!",HasRobbedRecently[playerid]);
SendClientMessage(playerid,COLOR_ERROR,string);
return 
1;
}

if(
IsInBank[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't use this command while in the bank");

if(
HasSecureWallet[ID] != 0)
{
SendClientMessage(playerid,COLOR_RED,"This player got wallet that saved him from robbery");
format(string,sizeof(string),"%s(%d) tried to rob you but your wallet saved you.",PlayerName(playerid),playerid);
SendClientMessage(ID,COLOR_DODGERBLUE,string);
HasSecureWallet[ID] -=1;
HasRobbedRecently[playerid] =180;
return 
1;
}
if(
GetPlayerMoney(ID) <= 0)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}That player has no money in their pockets. What would be the point in robbing them?");
return 
1;
}
if(
InDuel[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You are in a Duel you can't use this command.");
return 
1;
}
if(
GetDistanceBetweenPlayers(playerid,ID) <= 3)
{
new 
mrand =random((10 GetPlayerMoney(ID)) / 100);
format(string,sizeof(string),"(CRIME COMMITED) - You have robbed $%d from %s(%d).",mrand,PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_RED,string);
format(string,sizeof(string),"~n~~n~~n~~n~~y~YOU ROBBED~n~~w~$%d ~r~GAINED",mrand);
GameTextForPlayer(playerid,string,6000,3);
GivePlayerMoney(playerid,mrand);
IncreaseWantedLevel(playerid,4);
HasRobbedRecently[playerid] =60;
IncreasePlayerScore(playerid,2);

format(string,sizeof(string),"~n~~n~~n~~n~~y~YOU ARE ROBBED~n~~w~$%d ~r~LOST",mrand);
GameTextForPlayer(ID,string,6000,3);
GivePlayerMoney(ID,-mrand);

format(string,sizeof(string),"{FFA500}[ROBBERY] {FFFFFF}%s(%d) has robbed {00FF00}$%d {FFFFFF}from %s(%d).",PlayerName(playerid),playerid,mrand,Playe rName(ID),ID);
SendClientMessageToAll(COLOR_RED,string);

format(string,sizeof(string),"4[ROBBERY] %s(%d) has robbed $%d from %s(%d) ..",PlayerName(playerid),playerid,mrand,PlayerNam e(ID),ID);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 
1;
}
return 
1;

Reply
#6

but what bout other ones all cmds are bugged! and i'm getting four errors in there! the code u just gave me
Reply
#7

Try to do something like this :
PHP код:
if(sscanf(params"u"ID)) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /rob (Player Name/ID)");
if(
ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ERROR,"Invalid ID. You cannot rob them");
if(
IsSpawned[playerid] != 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You must be alive and spawned in order to be able to use this command.");
if(
gTeam[playerid] < 9) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
if(
gTeam[playerid] == TEAM_STUNT) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command with your class/skill.");
if(
gTeam[ID] == TEAM_STUNT) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on stunters.");
if(
GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot Rob someone while in an Interior");
if(
IsFrozen[playerid] == 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You have been frozen by a Server Administrator. You cannot use this command.");
if(
InAdminMode[ID] == 1) return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You cannot use this command on this player because they are in Administrator mode.");
if(
IsKidnapped[playerid] >= 1)return SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You are kidnapped. You cannot use this command.");
if(
Away[playerid] == 1) return SendClientMessage(playeridCOLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while you are in AFK.");
if(
Away[ID] == 1) return SendClientMessage(playeridCOLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}You can't rob someone while he is in AFK."); 
its not the full codes but you get my idea.
Reply
#8

oh and you can use only ONE command procceser in your script
Reply
#9

what?
Reply
#10

i mean you can you one command processor eg: dcmd
if you are using dcmd for some commands you cannot use zcmd in other commands

EDIT: also show your OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)