SA-MP Forums Archive
Doors 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: Doors help (/showthread.php?tid=508164)



Doors help - EthanMason - 20.04.2014

Hello guys, i've scripted this but for some reason it's not working in game, can i have some help?

Код:
if(strcmp(cmdtext, "/door", true) == 0)
	{

	    if(IsPlayerInRangeOfPoint(playerid,3.0 ,127.2629,1123.8804,527.4631))
		{ //POLICE DOOR 1
		    if(!IsACop(playerid)&& !IsAnAgent(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SAST !");
 			if(pddoor1==0)
    		{
     			pddoor1 = 1;
       			SetObjectRot( pddoor1obj, 0.0000, 0.0000, -90.0000);
	        	SetObjectPos( pddoor1obj, 126.5166, 1123.2622, 526.4631 );
       		}
	    	else if(pddoor1==1)
		   	{
		       	pddoor1 = 0;
       			SetObjectRot( pddoor1obj, 0.0000, 0.0000, 0.0000);
	        	SetObjectPos( pddoor1obj, 126.5166, 1123.2622, 526.4631 );
		   	}
		}
		if(IsPlayerInRangeOfPoint(playerid,3.0 ,127.26232, 1083.36389, 522.89319))
		{ //POLICE DOOR 2
		    if(!IsACop(playerid) && !IsAnAgent(playerid)) return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SAST !");
	    	if(pddoor2==0)
    		{
     			pddoor2 = 1;
       			SetObjectRot( pddoor2obj, 0.0000, 0.0000, -180.0000);
	        	SetObjectPos( pddoor2obj, 127.2283, 1084.8819, 522.8932 );
       		}
	    	else if(pddoor2==1)
		   	{
		       	pddoor2 = 0;
       			SetObjectRot( pddoor2obj, 0.0000, 0.0000, -90.0000);
	        	SetObjectPos( pddoor2obj, 127.2283, 1084.8819, 522.8932 );
		   	}
		}
		return 1;
	}



Re: Doors help - Marshall32 - 21.04.2014

One of the variables is the problem, check if you set the variables all right.