04.05.2013, 13:57
Another problem
When I type /winner [playerid], then it's pop up the game text without a name and winner don't get any score or money.
I have this stock:
Code:
When I type /winner [playerid], then it's pop up the game text without a name and winner don't get any score or money.
I have this stock:
PHP код:
stock GetName(playerid)
{
new
name[24];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
PHP код:
CMD:winner(playerid, params[])
{
new string[200];
new targetid;
if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "You are Not Allowed To Use This Command!");
if(gPlayerInfo[playerid][PLAYER_JAILED] == 1)return SendClientMessage(playerid, COLOR_RED, "ERROR: You Cannot Use Any Command When You're Jailed!");
if(sscanf(params, "s", targetid)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /winner [playerid]");
format(string, sizeof(string), "~w~Derby event has ~g~FINISHED~W~! Congratz to~g~ %s ~w~, he earned ~g~$30000 cash ~w~and ~g~30 scores!", GetName(targetid));
GameTextForAll(string,5000,3);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 30);
GivePlayerMoney(targetid, 30000);
return 1;
}