01.01.2012, 08:27
hey, can somone help me with this, im so confused, i go in game type /pay to my id just to test it but it just pays 0 to me as the id i am
Код HTML:
if (strcmp("/pay", cmd, true) == 0)
{
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /pay [player id][amount]");
new playeree = strval(tmp);
new playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
GetPlayerName(playeree, playername, MAX_PLAYER_NAME);
GetPlayerName(playerid, adminname, MAX_PLAYER_NAME);
if(!IsPlayerConnected(playeree)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
new tmp2[128];
new ammount = strval(tmp2);
if(ammount >= 0 && ammount <= 99999999)
if(GetPlayerMoney(playerid) < ammount) return SendClientMessage(playerid, COLOR_ROYALBLUE, "You don't have enough cash.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playeree, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 30, x, y, z))
{
format(string, sizeof(string), "%s Has Payed You $%i",adminname, ammount);
SendClientMessage(playeree, COLOR_RED, string);
format(string, sizeof(string), "You Have Payed %s $%i", playername, ammount);
SendClientMessage(playerid, COLOR_RED, string);
GivePlayerMoney(playeree, ammount);
}
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerInRangeOfPoint(i, 30, x, y, z))
{
format(string, sizeof(string), "%s has give some cash to %s", adminname, playername);
SendClientMessage(i ,COLOR_PINK, string);
}
return 1;
}

