Help with GetPlayerMoney.
#1

Hello!
I wanted to ask that how to get the players money and display it buy a Client message.Like if I do /mymoney it display my money through a client message.I need it for a function.Help would be appreciated.
Thank you.
Reply
#2

What do you use strcmp or zcmd or ycmd or other? (as a command processor)
Reply
#3

I use strcmp.((Not a pro scripter))
Reply
#4

Use sscanf or Strtok ?

EDIT : sorry, I misunderstood, I thought the cmd was getcash id.. try this cmd :

Код:
if (strcmp("/mymoney", cmdtext, true, 8) == 0)
{
new money;
new stringy[256]; 
money = GetPlayerMoney(playerid); 
format(stringy, sizeof(stringy), "[INFO-MONEY]: You have $%d", money); 
SendClientMessage(playerid, COLOR, stringy); 
return 1;
}
Reply
#5

sorry for the double post but please help I need it urgent,please.
Reply
#6

pawn Код:
if (strcmp("/mymoney", cmdtext, true, 8) == 0)
    {
        new string[128]; //creates the string to set the message for the player
        new money; //creates the var for the player's money
        money = GetPlayerMoney(playerid); //sets money as the player's current money
        format(string, sizeof(string), "You currently have $%d", money); //sets the message for the player
        SendClientMessage(playerid, -1, string); //sends the message
        return 1;
    }
You could use something as simple as this. If that's what you meant.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)