Adding A Line
#2

PHP код:
CMD:mask(playeridparams[])
{
    new 
name[MAX_PLAYER_NAME];
    new 
string[42];
    if(
PlayerInfo[playerid][pMask] == 0)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            if(
GetPlayerSkin(playerid) == 285)
            {
                if(
IsPlayerConnected(i))
                {
                
ShowPlayerNameTagForPlayer(iplayerid0);
                }
            }
        }
        
PlayerInfo[playerid][pMask] = 1;
        
GetPlayerName(playeridnamesizeof(name));
        
format(stringsizeof(string), "* %s has put a mask on."name);
        
ProxDetector(15.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if(
PlayerInfo[playerid][pMask] == 1)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
ShowPlayerNameTagForPlayer(iplayerid1);
            }
        }
        
PlayerInfo[playerid][pMask] = 0;
        
GetPlayerName(playeridnamesizeof(name));
        
format(stringsizeof(string), "* %s has put their mask away."name);
        
ProxDetector(15.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 
1;

Here you go.


EDIT : - With the message.

PHP код:
CMD:mask(playeridparams[])
{
    new 
name[MAX_PLAYER_NAME];
    new 
string[42];
    if(
PlayerInfo[playerid][pMask] == 0)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            if(
GetPlayerSkin(playerid) != 285)
            {
                return 
SendClientMessage(playeridCOLOR_WHITE,"You don't have the right skin to use this command.");
                }
                if(
IsPlayerConnected(i))
                {
                
ShowPlayerNameTagForPlayer(iplayerid0);
                }
        }
        
PlayerInfo[playerid][pMask] = 1;
        
GetPlayerName(playeridnamesizeof(name));
        
format(stringsizeof(string), "* %s has put a mask on."name);
        
ProxDetector(15.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if(
PlayerInfo[playerid][pMask] == 1)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
ShowPlayerNameTagForPlayer(iplayerid1);
            }
        }
        
PlayerInfo[playerid][pMask] = 0;
        
GetPlayerName(playeridnamesizeof(name));
        
format(stringsizeof(string), "* %s has put their mask away."name);
        
ProxDetector(15.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 
1;

Reply


Messages In This Thread
Adding A Line - by AchievementMaster360 - 10.06.2013, 22:05
Re: Adding A Line - by -CaRRoT - 10.06.2013, 22:07
Re: Adding A Line - by AchievementMaster360 - 10.06.2013, 22:13

Forum Jump:


Users browsing this thread: 1 Guest(s)