26.07.2016, 11:20
Can not give cash to myself.it says that the player is not connected. Plz solve the problem..
CMD:givecash(playerid, params[])
{
//check if the player is a admin
LevelCheck(playerid, 3);
new target, amount;
if(sscanf(params, "ui", target, amount)) return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /givecash [player] [amount]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: The specified player is not conected.");
GivePlayerMoney(target, amount);
PlayerPlaySound(target, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
new string[144];
format(string, sizeof(string), "admin %s[%i] has given you money $%i.", ReturnPlayerName(playerid), playerid, amount);
SendClientMessage(target, COLOR_DODGER_BLUE, string);
format(string, sizeof(string), "You have given %s[%i]'s money $%i.", ReturnPlayerName(target), target, amount);
SendClientMessage(playerid, COLOR_DODGER_BLUE, string);
return 1;
}
CMD:givecash(playerid, params[])
{
//check if the player is a admin
LevelCheck(playerid, 3);
new target, amount;
if(sscanf(params, "ui", target, amount)) return SendClientMessage(playerid, COLOR_THISTLE, "USAGE: /givecash [player] [amount]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: The specified player is not conected.");
GivePlayerMoney(target, amount);
PlayerPlaySound(target, 1057, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
new string[144];
format(string, sizeof(string), "admin %s[%i] has given you money $%i.", ReturnPlayerName(playerid), playerid, amount);
SendClientMessage(target, COLOR_DODGER_BLUE, string);
format(string, sizeof(string), "You have given %s[%i]'s money $%i.", ReturnPlayerName(target), target, amount);
SendClientMessage(playerid, COLOR_DODGER_BLUE, string);
return 1;
}