Engine On/Off
#6

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Samp wiki ;)
How NOT to check for a key

Lets presume that you want to detect when a player presses their FIRE button, the obvious code would be:

if (newkeys == KEY_FIRE)

This code may even work in your testing, but it is wrong and your testing is insufficient. Try crouching and pressing fire - your code will instantly stop working. Why? Because "newkeys" is no longer the same as "KEY_FIRE", it is the same as "KEY_FIRE" COMBINED WITH "KEY_CROUCH".
fair enough, i changed to & BUT it didn't solve my problem
Код:
                    else if(gEngine[playerid] == 1)
                    {
					engineOn[GetPlayerVehicleID(playerid)] = false;
					//RemovePlayerFromVehicle(playerid);
					TogglePlayerControllable(playerid, 0);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "* %s turns off the engine.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					gEngine[playerid] = 0;
					return 1;
				}
i need this command to work but it dosen't why? when i turn the engine on it works, but when i want to turn the engine off it wont ...
Reply


Messages In This Thread
Engine On/Off - by wordas - 21.01.2010, 16:50
Re: Engine On/Off - by wordas - 21.01.2010, 18:16
Re: Engine On/Off - by Striker_Moe - 21.01.2010, 18:23
Re: Engine On/Off - by wordas - 22.01.2010, 08:26
Re: Engine On/Off - by [HiC]TheKiller - 22.01.2010, 08:34
Re: Engine On/Off - by wordas - 22.01.2010, 08:39
Re: Engine On/Off - by Nexotronix - 02.03.2010, 15:47
Re: Engine On/Off - by Scenario - 02.03.2010, 15:48

Forum Jump:


Users browsing this thread: 2 Guest(s)