26.07.2017, 23:09
(
Последний раз редактировалось HoussamMaroc; 27.07.2017 в 12:57.
Причина: SetPlayerMoney(playerid, ammount); Changed To SetPlayerCash(playerid, ammount);
)
Try This
PHP код:
CMD:setcash(playerid, params[])
{
new tmp[256],tmp2[256],ammount,player, Index; tmp = strtok(params,Index); tmp2 = strtok(params,Index);
player = strval(tmp);
ammount = strval(tmp2);
if(IsPlayerConnected(player))
{
if(PlayerInfo[playerid][Adminlevel] >= 3)
{
if(!strlen(tmp))
{
return SendClientMessage(playerid, COLOR_RED, "USAGE: {0ce800}/setcash {0000ff}[PlayerId/PartOfName]{ff0000} [Ammount]");// Here When You Say "PartOfName" The Player Who Use This CMD Send The 'Money' To Player Who Have ID : "0"
}
if(!strlen(tmp2))
{
return SendClientMessage(playerid, COLOR_RED, "USAGE: {0ce800}/setcash {0000ff}[PlayerId/PartOfName]{ff0000} [Ammount]");// Here When You Say "PartOfName" The Player Who Use This CMD Send The 'Money' To Player Who Have ID : "0"
}
if(ammount <= 99999999)
{
new string[64]; new Name[MAX_PLAYER_NAME]; new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(player, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Administrator \"%s\" has set your cash to '$%d'", Name, ammount);
SendClientMessage(player, COLOR_GREEN, string);
format(string, sizeof(string), "You Gave $%d Money To \"%s\" .", ammount, PlayerName);
SendClientMessage(playerid, COLOR_GREEN, string);
SetPlayerCash(playerid, ammount);
}
else return SendClientMessage(playerid, COLOR_RED, "You can't give so much");
}
else return SendClientMessage(playerid,COLOR_RED,"You Can't Use This Command");
}
else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
return 1;
}
stock SetPlayerCash(playerid, cash)
{
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
GivePlayerMoney(playerid, cash);
return 1;
}
Quote:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase |