SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 27/04/2011, 03:16 PM   #1
Panormitis
Big Clucker
 
Join Date: May 2010
Posts: 96
Reputation: 0
Default New way o payout

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!
Panormitis is offline  
Old 27/04/2011, 03:24 PM   #2
Sinner
Gangsta
 
Sinner's Avatar
 
Join Date: Aug 2010
Location: On This Mortal Coil
Posts: 770
Reputation: 292
Default Re: New way o payout

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;

__________________
Please use the search feature before asking a question.
Sinner is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 11:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.