What is wrong with this code? Please Help!
#1

Hey,

I wanna fix my fire command since its not working, pretty much it creates fire objects but I cant seem to get it to put them out here is what I have under the command to create the fires:

Код:
 	fire1 = CreateObject(18691, x+10, y+0, z-1, fax, fay, faz);
   	fire2 = CreateObject(18691, x+10, y+2, z-1, fax, fay, faz);
   	fire3 = CreateObject(18691, x+10, y-2, z-1, fax, fay, faz);
   	fire4 = CreateObject(18691, x+10, y+4, z-1, fax, fay, faz);
   	fire5 = CreateObject(18691, x+10, y-4, z-1, fax, fay, faz);
   	SetTimer("spraycheck", 5000, 1);
Then I have this under the timer:

Код:
	if(GetPlayerCameraFrontVector(playerid, x, y, z) == fire1 && weaponid == 42 || GetPlayerCameraFrontVector(playerid, x, y, z) == fire2 && weaponid == 42 || GetPlayerCameraFrontVector(playerid, x, y, z) == fire3 && weaponid == 42 || GetPlayerCameraFrontVector(playerid, x, y, z) == fire4 && weaponid == 42 || GetPlayerCameraFrontVector(playerid, x, y, z) == fire5 && weaponid == 42)
	{
		if(newkeys & KEY_FIRE)
			{
		    SetTimer("sprayputout", 10000, 1);
		    SendClientMessage(playerid, COLOR_GREEN, "You begin to put out the fire...");
Then under that timer I have:

Код:
	DestroyObject(fire1);
	DestroyObject(fire2);
	DestroyObject(fire3);
	DestroyObject(fire4);
	DestroyObject(fire5);
Why isnt it removing that fire objects once the person sprays them with the extinguisher? Please Help Thanks!


Also when I compile it I get no errors but it creates the fires but I cant put them out...
Reply
#2

SetTimer("sprayputout", 10000, 1); // why have you give repeat true?

Try this

SetTimer("sprayputout", 10000, 0);
Reply
#3

Same result, anyone else please help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)