SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (/showthread.php?tid=627239)



Help - HassanShah - 25.01.2017

I'm using this CMD and even defined it fully, The roadblocks were getting placed before and when I checked after a day, they weren't working.. And even the TextDraw appears but no RoadBlocks.. Please help me out..

Код:
dcmd_crb(playerid,params[])
{
	new rb;
    if(IsPlayerConnected(playerid) && gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA || AdminLevel[playerid] == 1337)
	{
	    if(sscanf(params, "i", rb))
	    {
	        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb (Roadblock ID)");
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Available Roadblocks]");
			SendClientMessage(playerid, COLOR_GREY, "| 1: Small Roadblock | 2: Medium Roadblock |");
			SendClientMessage(playerid, COLOR_GREY, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |");
			SendClientMessage(playerid, COLOR_GREY, "| 6: Will Be Sign | 7: Line Closed Sign |");
			return 1;
		}
		if(IsKidnapped[playerid] == 1)
		{
		    SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
		    return 1;
		}
		if(IsRegularPlayer[playerid] != 1337)
		{
			SendClientMessage(playerid,COLOR_ERROR,"You must be a regular player to place roadblocks.");
			return 1;
		}
		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessage(playerid,COLOR_ERROR,"You cannot place a roadblock while in a vehicle. What are you? Superman?");
			return 1;
		}
        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);
	        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);
	        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);
	        GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
	        SafeSetPlayerPos(playerid, plocx, plocy+5, 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);
	        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);
	        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);
	        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);
	        GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
			return 1;
		}
	}
	return 1;
}



Re: Help - ThatFag - 25.01.2017

Well show
Код:
CreateRoadblock
or if i'd be you i would only use
Код:
CreateDynamicObject
instant of that one you using.


Re: Help - HassanShah - 26.01.2017

it's giving me these Errors

Код:
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4104) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4104) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4114) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4114) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4124) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4124) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4135) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4135) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4145) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4145) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4155) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4155) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4165) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(4165) : warning 202: number of arguments does not match definition
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(16976) : error 021: symbol already defined: "CreateDynamicObject"
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(16978) : error 010: invalid function or declaration
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(16980) : error 010: invalid function or declaration
D:\Hassan's Files\AGamemodes\Battle Los Angeles\gamemodes\SFCRRPG.pwn(16987) : error 010: invalid function or declaration
Now?


Re: Help - ThatFag - 26.01.2017

can u show lines error? is it comming from the dynamic object ?


Re: Help - HassanShah - 26.01.2017

Код:
CreateDynamicObject(3091,plocx,plocy,plocz+0.5,ploca+180);
This is the all types of the Errors


Re: Help - X337 - 26.01.2017

CreateDynamicObject parameters are
Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_OBJECT_SD, Float:drawdistance = STREAMER_OBJECT_DD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
You need to provide atleast position and rotation coordinates.

However, revert your code back to 'CreateRoadblock' and show us of your CreateRoadblock() function here.


Re: Help - HassanShah - 26.01.2017

Код:
CreateRoadblock(Object,Float:x,Float:y,Float:z,Float:Angle)
Here you go


Re: Help - HassanShah - 28.01.2017

No reply in 48 hours, BUMP!


Re: Help - HassanShah - 30.01.2017

68 Hours Passed, BUMP!


Re: Help - Dayrion - 30.01.2017

Quote:
Originally Posted by ThatFag
Посмотреть сообщение
Well show
Код:
CreateRoadblock
Show it