Change to FS and only for medic/FD skins help
#1

Can someone help me change this roadblock gamemode script into a filescript. And instead of for the police it be for skins: 274 275 276 277 278 279 (medics and firefighters)? I know nothing about scripting so if someone could post the new code that would be excellent!

Thanks so much: jakejohnsonusa

PS: I will +1 rep.


Код:
//--------------------------------=[Roadblock]=-----------------------------------
    if(strcmp(cmd, "/crb", true) == 0 || strcmp(cmd, "/createroadblock", true) == 0)
	{
	    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
     	{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
				SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock | 2: Medium Roadblock |");
				SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |");
				SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
				return 1;
			}
            new rb = strval(tmp);
            if (rb == 1)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(1459,plocx,plocy,plocz,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
				return 1;
			}
			else if (rb == 2)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
				return 1;
			}
			else if (rb == 3)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
		        SafeSetPlayerPos(playerid, plocx, plocy+1.3, plocz);
				return 1;
			}
			else if (rb == 4)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
				return 1;
			}
			else if (rb == 5)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
				return 1;
			}
			else if (rb == 6)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
				return 1;
			}
			else if (rb == 7)
			{
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
				return 1;
			}
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /createroadblock %d",d,m,y,h,mi,s,sendername, rb);
			CommandLog(string);
		}
	    return 1;
	}
	
	if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0)
	{
	    if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
     	{
        	DeleteClosestRoadblock(playerid);
        	format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",sendername);
	        SendRadioMessage(1,COLOR_BLUE,string);
	        GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
	        new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
			CommandLog(string);
		}
	    return 1;
	}
	
	if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
	{
	    if(IsPlayerConnected(playerid) && IsACop(playerid)  || PlayerInfo[playerid][pAdmin] >= 2)
     	{
			if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
			{
        		DeleteAllRoadblocks(playerid);
        		format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
	        	SendRadioMessage(1,COLOR_BLUE,string);
	        	GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
	        	new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
				CommandLog(string);
			}
		}
	    return 1;
	}
Reply
#2

pawn Код:
//--------------------------------=[Roadblock]=-----------------------------------
    if(strcmp(cmd, "/crb", true) == 0 || strcmp(cmd, "/createroadblock", true) == 0)
    {
            new pSkin = GetPlayerSkin(playerid);
        if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid) || pSkin == 274 || pSkin == 275 || pSkin == 276 || pSkin == 277 || pSkin == 278 || pSkin == 279)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
                SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock | 2: Medium Roadblock |");
                SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |");
                SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
                return 1;
            }
            new rb = strval(tmp);
            if (rb == 1)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1459,plocx,plocy,plocz,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 1;
            }
            else if (rb == 2)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 1;
            }
            else if (rb == 3)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
                SafeSetPlayerPos(playerid, plocx, plocy+1.3, plocz);
                return 1;
            }
            else if (rb == 4)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 5)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 6)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 7)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /createroadblock %d",d,m,y,h,mi,s,sendername, rb);
            CommandLog(string);
        }
        return 1;
    }
   
    if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0)
    {
        if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2 || pSkin == 274 || pSkin == 275 || pSkin == 276 || pSkin == 277 || pSkin == 278 || pSkin == 279)
        {
            DeleteClosestRoadblock(playerid);
            format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",sendername);
            SendRadioMessage(1,COLOR_BLUE,string);
            GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
            CommandLog(string);
        }
        return 1;
    }
   
    if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
    {
        if(IsPlayerConnected(playerid) && IsACop(playerid)  || PlayerInfo[playerid][pAdmin] >= 2 || pSkin == 274 || pSkin == 275 || pSkin == 276 || pSkin == 277 || pSkin == 278 || pSkin == 279)
        {
            if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
            {
                DeleteAllRoadblocks(playerid);
                format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
                CommandLog(string);
            }
        }
        return 1;
    }
That should do it.
Reply
#3

pawn Код:
//--------------------------------=[Roadblock]=-----------------------------------
    if(strcmp(cmd, "/crb", true) == 0 || strcmp(cmd, "/createroadblock", true) == 0)
    {
            new pSkin = GetPlayerSkin(playerid);
        if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid) || pSkin == 274 || pSkin == 275 || pSkin == 276 || pSkin == 277 || pSkin == 278 || pSkin == 279)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
                SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock | 2: Medium Roadblock |");
                SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |");
                SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
                return 1;
            }
            new rb = strval(tmp);
            if (rb == 1)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1459,plocx,plocy,plocz,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 1;
            }
            else if (rb == 2)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 1;
            }
            else if (rb == 3)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
                SafeSetPlayerPos(playerid, plocx, plocy+1.3, plocz);
                return 1;
            }
            else if (rb == 4)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 5)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 6)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 7)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /createroadblock %d",d,m,y,h,mi,s,sendername, rb);
            CommandLog(string);
        }
        return 1;
    }
   
    if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0)
    {
        if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2 || pSkin == 274 || pSkin == 275 || pSkin == 276 || pSkin == 277 || pSkin == 278 || pSkin == 279)
        {
            DeleteClosestRoadblock(playerid);
            format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",sendername);
            SendRadioMessage(1,COLOR_BLUE,string);
            GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
            CommandLog(string);
        }
        return 1;
    }
   
    if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
    {
        if(IsPlayerConnected(playerid) && IsACop(playerid)  || PlayerInfo[playerid][pAdmin] >= 2 || pSkin == 274 || pSkin == 275 || pSkin == 276 || pSkin == 277 || pSkin == 278 || pSkin == 279)
        {
            if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
            {
                DeleteAllRoadblocks(playerid);
                format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
                new y, m, d;
                new h,mi,s;
                getdate(y,m,d);
                gettime(h,mi,s);
                format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
                CommandLog(string);
            }
        }
        return 1;
    }
EDIT:
He got it before me U_U...
Reply
#4

Ok, Can you guys fix 3 things... make it ONLY for those skins NOT admins or cops... and make it be able to be removed also ONLY by these skins. (I tried to do this myself, but the compileing stopped working...crashed).
Also is this now in filescript form, as thats what I would like it to be. +1 Rep given, but I could still use the fixed code...

Thanks: jakejohnsonusa
Reply
#5

...bump...
Reply
#6

Can someone make this a FS for ONLY the skins mentioned? The one given did not work at all. Thanks so much! I will still +1 Rep any one that can help.

Thanks: jakejohnsonusa
Reply
#7

Try this, it should work -

Код:
//--------------------------------=[Roadblock]=-----------------------------------
    if(strcmp(cmd, "/crb", true) == 0 || strcmp(cmd, "/createroadblock", true) == 0)
	{
	new Skin;
        Skin = GetPlayerSkin(playerid);
	if(IsPlayerConnected(playerid)
    	if(Skin == 274||Skin == 275||Skin == 276||Skin ==277||Skin ==278||Skin ==279)
     	{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]");
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:");
				SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock | 2: Medium Roadblock |");
				SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |");
				SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
				return 1;
			}
            new rb = strval(tmp);
            if (rb == 1)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(1459,plocx,plocy,plocz,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
				return 1;
			}
			else if (rb == 2)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
				return 1;
			}
			else if (rb == 3)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
		        SafeSetPlayerPos(playerid, plocx, plocy+1.3, plocz);
				return 1;
			}
			else if (rb == 4)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
				return 1;
			}
			else if (rb == 5)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
				return 1;
			}
			else if (rb == 6)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
				return 1;
			}
			else if (rb == 7)
			{
			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
			new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
		        GetPlayerPos(playerid, plocx, plocy, plocz);
		        GetPlayerFacingAngle(playerid,ploca);
		        CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",sendername);
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
			return 1;
			}
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /createroadblock %d",d,m,y,h,mi,s,sendername, rb);
			CommandLog(string);
		}
	    return 1;
	}

	if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0)
	{
	    new Skin;
  	    Skin = GetPlayerSkin(playerid);
	    if(IsPlayerConnected(playerid)
     	{
        	DeleteClosestRoadblock(playerid);
        	format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",sendername);
	        SendRadioMessage(1,COLOR_BLUE,string);
	        GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
	        new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
			CommandLog(string);
		}
	    return 1;
	}

	if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0)
	{
	    new Skin;
  	    Skin = GetPlayerSkin(playerid);
	    if(IsPlayerConnected(playerid)
	    if(Skin == 274||Skin == 275||Skin == 276||Skin ==277||Skin ==278||Skin ==279)
     	{
			if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
			{
        		DeleteAllRoadblocks(playerid);
        		format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername);
	        	SendRadioMessage(1,COLOR_BLUE,string);
	        	GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
	        	new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
				CommandLog(string);
			}
		}
	    return 1;
	}
Reply
#8

When I try to compile this into a FS the compiler stops working. Still... can someone fix this again? Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)