Player id problem
#7

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
PHP код:
CMD:givecash(playeridparams[]) 

    if(
sscanf(params"ud"params[0], params[1])) return SendClientMessage(playerid, -1"SERVER(S): /givecash <playerid/name> <amount>"); 
    if(!
IsPlayerConnected(params[0]) || playerid == params[0]) return SendClientMessage(playerid, -1"SERVER{ff0000}(E){FFFFFF}: Target ID is offline/yourself.");
    if(
params[1] > 100000 || params[1] <= 0) return SendClientMessage(playerid, -1"SERVER{ff0000}(E){FFFFFF}: Your amount value should be between $1 to $100,000.");
    if(
params[1] > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1"SERVER{ff0000}(E){FFFFFF}: You don't have enough money to send.");
    
GivePlayerMoney(playerid, -params[1]);
    
GivePlayerMoney(params[0], params[1]);
    
    new 
string[145];
    
format(stringsizeof(string), "~g~+%d$"params[1]);
    
GameTextForPlayer(params[0], string30001);
    
format(stringsizeof(string), "~r~-%d$"params[1]);
    
GameTextForPlayer(playeridstring30001);
    
    
format(stringsizeof(string), "- {FFF2E7}%s(%d) has sent you '%d$'."GetName(playerid), playeridparams[1]);  SendClientMessage(params[0], -1string); 
    
format(stringsizeof(string), "- {FFF2E7}You've sent '%d$' to %s(%d)"params[1], GetName(params[0]), params[0]); SendClientMessage(playerid, -1string); 
    return 
1
}
stock GetName(playerid)
{
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    return 
playername;

Spoonfeeding!

Quote:
Originally Posted by CaptainBoi
Посмотреть сообщение
PHP код:
GetPlayerNameEx(playerid)
{
 new 
pname[25];
 
GetPlayerName(playeridpnamesizeof(pname));
 return 
pname;
}
CMD:givecash(playeridparams[]) 

    new 
targetidamountstring[128]; 
    if (
sscanf(params"ud"targetidamount)) SendClientMessage(playerid, -1"SERVER(S): /givecash <playerid/name> <amount>"); 
    if(!
IsPlayerConnected(targetid) || targetid == playerid) return SendClientMessage(playerid, -1"SERVER{ff0000}(E){FFFFFF}: Target ID is offline/yourself."); 
    if (
amount GetPlayerMoney(playerid)) SendClientMessage(playerid, -1"SERVER{ff0000}(E){FFFFFF}: You don't have enough money to send."); 
    if (
amount && amount 100000SendClientMessage(playerid, -1"SERVER{ff0000}(E){FFFFFF}: Your amount value should be between 1 to 100,000."); 
    
    
GivePlayerMoney(targetidamount); 
    
GivePlayerMoney(playerid, -amount); 
    
    
format(stringsizeof(string), "~g~+%d$"amount); 
    
GameTextForPlayer(targetidstring30001); 
    
    
format(stringsizeof(string), "~r~-%d$"amount); 
    
GameTextForPlayer(playeridstring30001); 
    
    
format(stringsizeof(string), "- {FFF2E7}%s(%d) has sent you '%d$'."GetPlayerNameEx(playerid), playeridamount); 
    
SendClientMessage(targetid, -1string); 
    
    
format(stringsizeof(string), "- {FFF2E7}You've sent '%d$' to %s(%d)"amountGetPlayerNameEx(targetid), targetid); 
    
SendClientMessage(playerid, -1string); 
    return 
1

Spoonfeeding!

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
Why copy something I've done before? If it is already solved, you do not need to respond simply for wanting to attract attention.
Still, spoon feeding!
Reply


Messages In This Thread
Player id problem - by KayJ - 29.09.2018, 06:49
Re: Player id problem - by Calisthenics - 29.09.2018, 07:35
Re: Player id problem - by TheToretto - 29.09.2018, 11:39
Re: Player id problem - by Undef1ned - 29.09.2018, 15:14
Re: Player id problem - by CaptainBoi - 29.09.2018, 18:20
Re: Player id problem - by Undef1ned - 29.09.2018, 20:53
Re: Player id problem - by solstice_ - 29.09.2018, 21:04
Re: Player id problem - by J0sh... - 29.09.2018, 21:10
Re: Player id problem - by TheToretto - 29.09.2018, 22:22
Re: Player id problem - by solstice_ - 29.09.2018, 23:28

Forum Jump:


Users browsing this thread: 1 Guest(s)