Comando de dar grana
#4

ZCMD

PHP Code:
COMMAND:givemoney(playeridparams[])
{
    new 
Msg[128], Name[24], OtherName[24], OtherPlayerMoney;
    if (
APlayerData[playerid][LoggedIn] == true)
    {
        if (
sscanf(params"ui"OtherPlayerMoney)) SendClientMessage(playerid0xFF0000AA"Utilizaзгo: \"/dargrana <jogador> <quantidade>\"");
        else
        {
            if (
IsPlayerConnected(OtherPlayer))
            {
                
GetPlayerName(playeridNamesizeof(Name));
                
GetPlayerName(OtherPlayerOtherNamesizeof(OtherName));
                if (
Money 0)
                {
                    
// Check if the player has enough money
                    
if (APlayerData[playerid][PlayerMoney] >= Money)
                    {
                        
// Transfer the money
                        
RewardPlayer(playerid, -Money0);
                        
RewardPlayer(OtherPlayerMoney0);
                        
// Let the other player know that he has received money
                        
format(Msg128"{00FF00}Vocк recebeu {FFFF00}$%i{00FF00} de {FFFF00}%s"MoneyName);
                        
SendClientMessage(OtherPlayer0xFFFFFFFFMsg);
                        
// Let the player know he gave money to somebody else
                        
format(Msg128"{00FF00}Vocк deu {FFFF00}$%i{00FF00} ao {FFFF00}%s"MoneyOtherName);
                        
SendClientMessage(playerid0xFFFFFFFFMsg);
                        
PlayerFile_Save(playerid);
                        
PlayerFile_Save(OtherPlayer);
                    }
                    else
                        
SendClientMessage(playerid0xFFFFFFFF"{FF0000}Vocк nгo tem grana suficiente");
                }
                else
                    
SendClientMessage(playerid0xFFFFFFFF"{FF0000}Tem de utilizar valores maiores do que 0");
            }
            else
                
SendClientMessage(playerid0xFFFFFFFF"{FF0000}O jogador nгo estб online");
        }
    }
    else
        return 
0;
    return 
1;

Reply


Messages In This Thread
Comando de dar grana - by Felipe_Wesker - 06.08.2011, 16:18
Re: Comando de dar grana - by Dark.Angel - 06.08.2011, 16:32
Re: Comando de dar grana - by 1The1AleX1 - 06.08.2011, 16:35
Re: Comando de dar grana - by array13 - 06.08.2011, 16:40
Re: Comando de dar grana - by Felipe_Wesker - 06.08.2011, 18:04
Re: Comando de dar grana - by crush_ - 06.08.2011, 18:24
Re: Comando de dar grana - by Vai_Besta - 07.08.2011, 14:16
Re: Comando de dar grana - by array13 - 08.08.2011, 12:54
Re: Comando de dar grana - by Sr.Pekeno - 08.08.2011, 13:01

Forum Jump:


Users browsing this thread: 3 Guest(s)