[Question] How to give score?
#3

Код:
dcmd_givescore(playerid, params[])
{
	new
		giveplayerid,
		amount,
                gscore,
                score;

	if (sscanf(params, "ud", giveplayerid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /givescore         [playerid/partname] [amount]");
	else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else if (amount > GetPlayerScore(playerid)) SendClientMessage(playerid, 0xFF0000AA, "Insufficient Funds");
	else
	{
                GetPlayerScore(giveplayerid,gscore);
                GetPlayerScore(playerid,score);
		SetPlayerScore(giveplayerid,gscore+ amount);
		SetPlayerScore(playerid, score - amount);
		SendClientMessage(playerid, 0x00FF00AA, "Score sent");
		SendClientMessage(giveplayerid, 0x00FF00AA, "Score received");
	}
	return 1;
}
not tested but i think it works
Reply


Messages In This Thread
[Question] How to give score? - by Superrollo - 27.07.2011, 17:21
Re: [Question] How to give score? - by Riddick94 - 27.07.2011, 17:25
Re: [Question] How to give score? - by HuSs3n - 27.07.2011, 17:39
Re: [Question] How to give score? - by Superrollo - 02.08.2011, 21:33
Re: [Question] How to give score? - by =WoR=Varth - 03.08.2011, 03:07

Forum Jump:


Users browsing this thread: 1 Guest(s)