road block script
#1

Hi,

I'm using http://forum.sa-mp.com/showthread.ph...ghlight=rrball road blocks

and Can`t seem to compile it due to errors

Код:
Desktop\samp03csvr_win32\pawno\GLRP.pwn(3997) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4011) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4417) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4432) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4486) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4580) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4590) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(4708) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(11584) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(11622) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12598) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12599) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12643) : warning 204: symbol is assigned a value that is never used: "carid"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12644) : warning 204: symbol is assigned a value that is never used: "tires"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12642) : warning 203: symbol is never used: "lights"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12642) : warning 203: symbol is never used: "doors"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12642) : warning 203: symbol is never used: "panels"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12659) : warning 204: symbol is assigned a value that is never used: "carid"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12660) : warning 204: symbol is assigned a value that is never used: "tires"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12658) : warning 203: symbol is never used: "lights"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12658) : warning 203: symbol is never used: "doors"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(12658) : warning 203: symbol is never used: "panels"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(13578) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17929) : error 017: undefined symbol "CreateRoadblock"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17930) : error 017: undefined symbol "GPN"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17931) : error 017: undefined symbol "COLOR_BLUE"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17941) : error 017: undefined symbol "CreateRoadblock"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17942) : error 017: undefined symbol "GPN"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17943) : error 017: undefined symbol "COLOR_BLUE"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17953) : error 017: undefined symbol "CreateRoadblock"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17954) : error 017: undefined symbol "GPN"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17955) : error 017: undefined symbol "COLOR_BLUE"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17966) : error 017: undefined symbol "CreateRoadblock"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17967) : error 017: undefined symbol "GPN"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(17968) : error 017: undefined symbol "COLOR_BLUE"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(18015) : error 017: undefined symbol "DeleteClosestRoadblock"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(18016) : error 017: undefined symbol "GPN"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(18017) : error 017: undefined symbol "COLOR_BLUE"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(18028) : error 017: undefined symbol "DeleteAllRoadblocks"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(18029) : error 017: undefined symbol "GPN"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(18030) : error 017: undefined symbol "COLOR_BLUE"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(19537) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(19615) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(20940) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(20959) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(21024) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25309) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25335) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25360) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25406) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25420) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25452) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25454) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25483) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25486) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25489) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25501) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25506) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25519) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25523) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25531) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25559) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(25571) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(26224) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(26998) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(27024) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(27053) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(27055) : warning 204: symbol is assigned a value that is never used: "vehicle"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(30522) : warning 204: symbol is assigned a value that is never used: "rands"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(42209) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(42251) : warning 217: loose indentation
Desktop\samp03csvr_win32\pawno\GLRP.pwn(43814) : warning 204: symbol is assigned a value that is never used: "result"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(44218) : error 017: undefined symbol "MAX_ROADBLOCKS"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(44654) : warning 203: symbol is never used: "PlayerDrunk"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(44654) : warning 203: symbol is never used: "Roadblocks"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(44654) : warning 203: symbol is never used: "iOrder"
Desktop\samp03csvr_win32\pawno\GLRP.pwn(16318) : warning 204: symbol is assigned a value that is never used: "iTGB"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


19 Errors.
Reply
#2

post your code's so that we can help
Reply
#3

Ask in the original script thread. Thats your best bet.
Reply
#4

The road block code

3 parts of code to place into my gamemode script but I get those errors Please ask for the gamemode if needed thanks

// Search enum in your script and add this:
// Place this under OnPlayerCommandText
// Place this under your script

Код:
#include <a_samp>

// Top of your script
#define MAX_ROADBLOCKS 85 // Can be anything you want, but don't go over the top.

// Search enum in your script and add this:

enum rInfo
{
    sCreated,
    Float:sX,
    Float:sY,
    Float:sZ,
    sObject,
};
new Roadblocks[MAX_ROADBLOCKS][rInfo];

// Place this under OnPlayerCommandText

	if(strcmp(cmd, "/crb", 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");
				SendClientMessage(playerid, COLOR_GRAD1, "| 2: Medium Roadblock");
				SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock");
				SendClientMessage(playerid, COLOR_GRAD1, "| 3: Cone");
				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.",GPN(playerid));
		        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.",GPN(playerid));
		        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.",GPN(playerid));
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
		        SetPlayerPos(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.",GPN(playerid));
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
				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(1425,plocx,plocy,plocz+0.6,ploca);
		        format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",GPN(playerid));
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~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(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.",GPN(playerid));
		        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(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.",GPN(playerid));
		        SendRadioMessage(1,COLOR_BLUE,string);
		        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
				return 1;
			}*/
		}
	    return 1;
	}
	else if (strcmp(cmd,"/rrb",true) == 0)
	{
	    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
     	{
        	DeleteClosestRoadblock(playerid);
        	format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",GPN(playerid));
	        SendRadioMessage(1,COLOR_BLUE,string);
	        GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1);
		}
	    return 1;
	}
	else if (strcmp(cmd,"/rrball",true) == 0)
	{
	    if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
     	{
			if(PlayerInfo[playerid][pRank] >= 6 || IsPlayerAdmin(playerid)) // 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.",GPN(playerid));
	        	SendRadioMessage(1,COLOR_BLUE,string);
	        	GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1);
			}
		}
	    return 1;
	}

// Place this under your script

stock CreateRoadblock(Object,Float:x,Float:y,Float:z,Float:Angle)
{
    for(new i = 0; i < sizeof(Roadblocks); i++)
  	{
  	    if(Roadblocks[i][sCreated] == 0)
  	    {
            Roadblocks[i][sCreated] = 1;
            Roadblocks[i][sX] = x;
            Roadblocks[i][sY] = y;
            Roadblocks[i][sZ] = z-0.7;
            Roadblocks[i][sObject] = CreateDynamicObject(Object, x, y, z-0.9, 0, 0, Angle);
	        return 1;
  	    }
  	}
  	return 0;
}

stock DeleteAllRoadblocks(playerid)
{
    for(new i = 0; i < sizeof(Roadblocks); i++)
  	{
  	    if(IsPlayerInRangeOfPoint(playerid, 100, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
        {
	  	    if(Roadblocks[i][sCreated] == 1)
	  	    {
	  	        Roadblocks[i][sCreated] = 0;
	            Roadblocks[i][sX] = 0.0;
	            Roadblocks[i][sY] = 0.0;
	            Roadblocks[i][sZ] = 0.0;
	            DestroyDynamicObject(Roadblocks[i][sObject]);
	  	    }
  	    }
	}
    return 0;
}

stock DeleteClosestRoadblock(playerid)
{
    for(new i = 0; i < sizeof(Roadblocks); i++)
  	{
  	    if(IsPlayerInRangeOfPoint(playerid, 5.0, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
        {
  	        if(Roadblocks[i][sCreated] == 1)
            {
                Roadblocks[i][sCreated] = 0;
                Roadblocks[i][sX] = 0.0;
                Roadblocks[i][sY] = 0.0;
                Roadblocks[i][sZ] = 0.0;
                DestroyDynamicObject(Roadblocks[i][sObject]);
                return 1;
  	        }
  	    }
  	}
    return 0;
}
Reply
#5

if you are copying it into your gamemode, then remember to copy the color definitions, variables, etc., too..
if you can't manage to do so, just run the script the way it is (as filterscript)
Reply
#6

It's not a filterscript, but commands to place into your script. I wouldn't know how to make this as a fs(compiling wont work) And this is the only way to add it as listed on the thread. If you could offer any help on which sections to add this it would be appreciated.
Reply
#7

add me on msn (admin@sgt-site.tk) and install teamviewer6
Reply
#8

-.- those loose indentations are annoying... use

Код:
#pragma tabsize 0
Reply
#9

Quote:
Originally Posted by airsoft
Посмотреть сообщение
-.- those loose indentations are annoying... use

Код:
#pragma tabsize 0
Or do it right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)