New way o payout
#1

Hello world, here Is my Idea: I want to make a player for my server to get pay from a command, here is an excable, I have a command /lvtele ,when someone type this command, the player "Mathias" will take 200$ ( if he is online) , how make this? I have the command for the teleport, all I need is to make the player "Mathias" (excable) take money when someone type the command! Please help me with tha code! Thans!
Reply
#2

I assume you want this for any player that uses the command? Not just players with the name "Mathias", right?

Here:
PHP Code:
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/lvtele"true)==0)
    {
        
//Teleport the player
        
GivePlayerMoney(playerid200);
        return 
1;
    }
    return 
0;

If not, here:

PHP Code:
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/lvtele"true)==0)
    {
        
//Teleport the player
        
        
new playername[24];
        for(new 
i=0i<MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
GetPlayerName(iplayernamesizeof(playername));
                if(
strcmp(playername"Mathias"true)==0)
                {
                     
GivePlayerMoney(i200);
                }
            }
        }
        return 
1;
    }
    return 
0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)