the freaking /givemoney cmd :c
#1

Quote:

CMD:givemoney(playerid, params[])
{
new string[SOS];
new toplayerid, money, sendername[MAX_PLAYER_NAME], recievername[MAX_PLAYER_NAME];
if(sscanf(params,"ui", toplayerid, money)) return SendClientMessage(playerid, RED, "ERROR: /givemoney [Playerid] [Money]");
if(!IsPlayerConnected(toplayerid)) return SendClientMessage(playerid, RED, "ERROR: Player is not connected");
GetPlayerName(playerid, sendername, 24);
GetPlayerName(toplayerid, recievername, 24);
format(string, SOS, "You Have Sent %i $ To %s.", sendername);
SendClientMessage(playerid, GREEN, string);
format(string, SOS, "You Have Recieved %i $ From %s.", recievername);
SendClientMessage(toplayerid, GREEN, string);
GivePlayerMoney(playerid, -money);
GivePlayerMoney(toplayerid, money);
return 1;
}

this is the command but when i use it in game it says:
[10:38:15] You Have Sent 91 $ To .

[10:38:15] You Have Recieved 91 $ From .


Note:it ALWAYS says 91$ whatever if you typed any other amount and it doesn't show the name
Reply
#2

You are only passing the player names to the format function and not the amount of cash.
pawn Код:
CMD:givemoney(playerid, params[])
{
new string[SOS];
new toplayerid, money, sendername[MAX_PLAYER_NAME], recievername[MAX_PLAYER_NAME];
if(sscanf(params,"ui", toplayerid, money)) return SendClientMessage(playerid, RED, "ERROR: /givemoney [Playerid] [Money]");
if(!IsPlayerConnected(toplayerid)) return SendClientMessage(playerid, RED, "ERROR: Player is not connected");
GetPlayerName(playerid, sendername, 24);
GetPlayerName(toplayerid, recievername, 24);
format(string, SOS, "You Have Sent %i $ To %s.", money, sendername);
SendClientMessage(playerid, GREEN, string);
format(string, SOS, "You Have Recieved %i $ From %s.", money, recievername);
SendClientMessage(toplayerid, GREEN, string);
GivePlayerMoney(playerid, -money);
GivePlayerMoney(toplayerid, money);
return 1;
}
Reply
#3

Fuck lool was i that stupid?! xd +rep m8 thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)