Need help with /usemask
#4

PHP код:
if(strcmp(cmd"/usemask"true) == 0)// маска
    
{
        if(
PlayerInfo[playerid][pMask] == 1)
        {
            if(
PlayerInfo[playerid][pMaskOn] == 0)
            {
                
PlayerInfo[playerid][pMaskOn] = 1;
                for(new 
0MAX_PLAYERSi++)
                {
                    
ShowPlayerNameTagForPlayer(iplayerid0);
                }
                
SendClientMessage(playerid,COLOR_YELLOW,"Вы одели маску");
                
PlayerInfo[playerid][pMaskSkill] -= 1;
                
maska CreateDynamicObject(190381,1,1,0,0,0);
                
SetPlayerAttachedObject(playerid3maska2);
                if(
PlayerInfo[playerid][pMaskSkill] <= 0)
                {
                    new 
ranran random(100);
                    if(
ranran 2)
                    {
                        
SendClientMessage(playerid,COLOR_LIGHTRED,"Вы порвали маску");
                        
DestroyObject(maska);
                        
PlayerInfo[playerid][pMaskSkill] = 0;
                        
PlayerInfo[playerid][pMask] = 0;
                        
PlayerInfo[playerid][pMaskOn] = 0;
                        for(new 
0MAX_PLAYERSi++)
                        {
                            
ShowPlayerNameTagForPlayer(iplayerid1);
                        }
                    }
                }
            }
            else if(
PlayerInfo[playerid][pMaskOn] == 1)
            {
                
PlayerInfo[playerid][pMaskOn] = 0;
                for(new 
0MAX_PLAYERSi++)
                {
                for(new 
i=0i<MAX_PLAYER_ATTACHED_OBJECTSi++)
                {
                if(
IsPlayerAttachedObjectSlotUsed(playeridi)) RemovePlayerAttachedObject(playeridi);
                }
                    
ShowPlayerNameTagForPlayer(iplayerid1);
                }
                
DestroyObject(maska);
                
SendClientMessage(playerid,COLOR_YELLOW,"Вы сняли маску");
            }
        }
        else
        {
            
SendClientMessage(playerid,COLOR_GREY,"У вас нет маски");
        }
        return 
1;
    } 
not working, mask after 1 sec just lost
Reply


Messages In This Thread
Need help with /usemask - by MarkzD - 27.05.2014, 15:02
Re: Need help with /usemask - by rappy93 - 27.05.2014, 15:15
Re : Need help with /usemask - by S4t3K - 27.05.2014, 15:17
Re: Need help with /usemask - by MarkzD - 27.05.2014, 15:28
Re: Need help with /usemask - by MarkzD - 27.05.2014, 17:55
Re: Need help with /usemask - by MarkzD - 30.05.2014, 14:54

Forum Jump:


Users browsing this thread: 1 Guest(s)