15.09.2013, 04:10
Add this stock where all the other stocks or publics are:
Then replace your code with this:
Post me line 5 of your game mode and I'll fix that warning too.
pawn Код:
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}
pawn Код:
dcmd_givecash(playerid, params[])
{
new pID, value, string[128];
if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COLOR_CMDUSAGE, "USAGE : /givecash [playerid/Part of name] [amount]");
if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Error : Invalid ID");
if(value > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1, "You Dont Have That Much Cash");
if(pID == playerid) return SendClientMessage(playerid, -1, "That's You, You IDIOT");
if(value<0) return 0;
if(GetPlayerScore(playerid) == 0 && value >0) return SendClientMessage(playerid, -1, "You Need Atleast level 1 to givecash");
format(string, sizeof(string), "You transfered $%i to %s (%i)", value, PlayerName(pID), pID);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "You got $%i by %s (%i)", value, PlayerName(playerid), playerid);
SendClientMessage(pID, COLOR_YELLOW, string);
GivePlayerMoney(pID, value);
GivePlayerMoney(playerid, -value);
return 1;
}