Help in RB
#4

PHP код:
CMD:roadblock(playerid,params[])
{
    new 
numberatrb atblock[playerid];
    if(
sscanf(params,"d",number) || number || number 4)
    {
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: /rb <1/2/3/4>");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 1: Small Roadblock");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 2: Barrier");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 3: Traffic cone");
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 4: Detour sign");
        
SendClientMessage(playerid,COLOR_WHITE,"----------------------");
        
format(stringsizeof string,"The roadblock will expire after %i minutes, or use /REMOVEBLOCK for remove the lastest block.",EXPIRE_MINUTES);
        
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
        return 
1;
    }
    new 
Float:XFloat:YFloat:ZFloat:A;
    
GetPlayerPos(playeridXYZ);
    
GetPlayerFacingAngle(playeridA);
    if(
atblock[playerid] >= MAX_ROADBLOCKS){
        
format(string,sizeof string,"You cannot place more then %i Roadblocks!",MAX_ROADBLOCKS);
        
SendClientMessage(playeridCOLOR_REDstring);
        return 
1;
    }
    switch(
number){
        case 
1:{
            
block[atrb][playerid] = CreateObject(1459XY+1Z-0.5,0,0,A);
            
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);                                
        }
        case 
2:{              
            
block[atrb][playerid] = CreateObject(978XY+1Z,0,0,A);
            
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);            
        }
        case 
3:{                  
            
block[atrb][playerid] = CreateObject(1238XY+1Z-0.500.0,A);
            
GameTextForPlayer(playerid,"~w~Cone ~b~Placed!",3000,1);              
        }
        case 
4:{                    
            
block[atrb][playerid] = CreateObject(1425XY+1Z-0.500.0,A,300);
            
GameTextForPlayer(playerid,"~w~Sign ~b~Placed!",3000,1);        
        }    
    }
    
#if SEND == true
    
GetPlayerName(playerid,pName,32);
    
format(string,sizeof string," %s added a roadblock(%i).",pName,number);
    
SendClientMessageToAll(COLOR_GREENstring);
    
#else
    
SetTimerEx("ExpireRoadblock"EXPIRE_MINUTES*60000false"i"block[atrb][playerid]);
    
atblock[playerid] += 1;
    
#endif
    
return 1;

Reply


Messages In This Thread
Help in RB - by Adornil - 31.12.2015, 13:43
Re: Help in RB - by Stones - 31.12.2015, 14:34
Re: Help in RB - by SoFahim - 31.12.2015, 15:01
Re: Help in RB - by CodeStyle175 - 31.12.2015, 15:44
Re: Help in RB - by J4Rr3x - 31.12.2015, 15:50

Forum Jump:


Users browsing this thread: 1 Guest(s)