Cmd not working
#1

my cmd wont work it will work but it wont give any robskill if i try to give 5 it gives 0 any amount i try it gives 0
and it wont set the robskill can someone please help also this is stevo's127 cnr script

CODE
Код:
dcmd_setrob(playerid,params[])
{
	new ID;
	new amount;
	new string[128];
    if(sscanf(params,"ui",ID,RobSkill))
	{
	    SendClientMessage(playerid,COLOR_ERROR,"USAGE: /setrob) (Player Name/ID) (Amount)");
	    return 1;
	}
	if(IsSpawned[ID] == 0)
	{
	    format(string,sizeof(string),"%s(%d) is must be alive and spawned in order to give them robskill.",PlayerName(ID),ID);
	    SendClientMessage(playerid,COLOR_ERROR,string);
	    return 1;
	}
	if(!IsPlayerConnected(ID))
	{
	    format(string,sizeof(string),"The Player ID (%d) is not connected to the server.",ID);
	    SendClientMessage(playerid,COLOR_ERROR,string);
	    return 1;
	}
	RobSkill[playerid] = amount;
	format(string,sizeof(string),"[ADMIN Robskill] Administrator has given you Robskill. Amount: %d.",amount);
	SendClientMessage(ID,COLOR_ADMIN,string);

	format(string,sizeof(string),"[ADMIN Robskill] You have given %s(%d) Robskill. Amount: %d.",PlayerName(ID),ID,amount);
	SendClientMessage(playerid,COLOR_ADMIN,string);

	format(string,sizeof(string),"9[ADMIN Robskill] Administrator %s(%d) has set %s(%d) robskill. Amount: %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,amount);
	IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
	return 1;
}
Reply
#2

Код:
	RobSkill[playerid] = amount;
Into
pawn Код:
RobSkill[ID] = amount;
You're setting the command performers robskill.
Reply
#3

Still sets it to 0 everytime i type it look
Reply
#4

try
from
pawn Код:
RobSkill[ID] = amount;
to
pawn Код:
amount = RobSkill[ID];
Reply
#5

Replace
pawn Код:
if(sscanf(params,"ui",ID,RobSkill))
with
pawn Код:
if(sscanf(params,"ui",ID,amount))
Reply
#6

Thank u so much Kirollos +rep for u and i have another problem amount is not used warning

but everything works correctly i jsut wanna get rid of errors
Reply
#7

Never mind my reply, i got it wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)