SA-MP Forums Archive
Help me with this cmd - 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: Help me with this cmd (/showthread.php?tid=351949)



Help me with this cmd - San1 - 17.06.2012

This command wont work it suppose to give score but it does give score but it gives only me score even when i enter another id

its not sscanf mine is up to date and working fine becuz all ids work like /adgivecash [id] [amount] it works

but this cmd wont work idk why help me plz

not errors or warnings on compile also

Код:
dcmd_givescore(playerid, params[])
{
	new ID;
	new Value;
	new string[128];
    if(sscanf(params,"ui",ID,Value))
	{
	    SendClientMessage(playerid,COLOR_ERROR,"USAGE: /givescore(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 score.",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;
	}
	IncreasePlayerScore(playerid,Value);
	format(string,sizeof(string),"[ADMIN SCORE] Administrator has given you score. Amount: %d.",Value);
	SendClientMessage(ID,COLOR_ADMIN,string);

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

	format(string,sizeof(string),"9[ADMIN SCORE] Administrator %s(%d) has given %s(%d) score. Amount: %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,Value);
	IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
	return 1;
}



Re: Help me with this cmd - Kindred - 17.06.2012

pawn Код:
IncreasePlayerScore(playerid,Value);
You honestly see nothing wrong with that?

pawn Код:
IncreasePlayerScore(ID,Value);
See the difference?