[HELP] custom police car
#9

i make something like this

Код:
if (newkeys == KEY_CROUCH)
    {
        new pdlight1;
		new pdlight2;
		new pdlight3;
		new pdlight4;
		new pdlighton;
  		if(pdlighton == 0)
		{
    	                new checkcar = GetPlayerVehicleID(playerid);
		    if(checkcar == buffpd1)
		        {
		            pdlight1 = CreateObject(18646,0,0,0,0,0,0);
  		            AttachObjectToVehicle(pdlight1, buffpd1, 0, -0.0, 0, 2.0, 2.0, 3.0);
		            pdlighton = 1;
		        }
		    else if(checkcar == buffpd2)
 		        {
		            ipdlight2 = CreateObject(18646,0,0,0,0,0,0);
		            iAttachObjectToVehicle(pdlight2, buffpd2, 0, -0.0, 0, 2.0, 2.0, 3.0);
 		            ipdlighton = 1;
		        }
		    else if(checkcar == buffpd3)
			{
			    pdlight3 = CreateObject(18646,0,0,0,0,0,0);
			    AttachObjectToVehicle(pdlight3, buffpd3, 0, -0.0, 0, 2.0, 2.0, 3.0);
			    pdlighton = 1;
			}
			else if(checkcar == buffpd4)
			{
			    pdlight4 = CreateObject(18646,0,0,0,0,0,0);
			    AttachObjectToVehicle(pdlight4, buffpd4, 0, -0.0, 0, 2.0, 2.0, 3.0);
			    pdlighton = 1;
			}
		    return 1;
	    }
	    else
	    {
	        new checkcar = GetPlayerVehicleID(playerid);
    	        if(checkcar == buffpd1)
    	        {
    	            DestroyObject(pdlight1);
    	        }
                    else if(checkcar == buffpd2)
    	        {
    	            DestroyObject(pdlight2);
    	        }
                    else if(checkcar == buffpd3)
	        {
	            DestroyObject(pdlight3);
	        }
                    else if(checkcar == buffpd4)
	        {
	            DestroyObject(pdlight4);
	        }
                    return 1;
	    }
		    
    }
but when i use again KEY_CROUCH that police light is still there..

how can i make a variable which depend by carid?

or how i can solve this problem?
Reply


Messages In This Thread
[HELP] custom police car - by dk4ever - 10.03.2011, 20:07
Re: [HELP] custom police car - by xRyder - 10.03.2011, 20:10
Re: [HELP] custom police car - by dk4ever - 10.03.2011, 20:12
Re: [HELP] custom police car - by xRyder - 10.03.2011, 20:18
Re: [HELP] custom police car - by dk4ever - 10.03.2011, 20:20
Re: [HELP] custom police car - by dk4ever - 10.03.2011, 21:18
Re: [HELP] custom police car - by Loppa - 10.03.2011, 21:24
Re: [HELP] custom police car - by dk4ever - 10.03.2011, 21:33
Re: [HELP] custom police car - by dk4ever - 11.03.2011, 08:29
Re: [HELP] custom police car - by dk4ever - 11.03.2011, 10:43

Forum Jump:


Users browsing this thread: 1 Guest(s)