Problem with unlimmited nos reloads
#1

Hi what I want is when a player runs out of nitro, he can press the fire key, and the nos gets reloaded.
This however doesn't work.
Does anyone of you guys see the mistake/error in here?
Код:
	public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
		if(newkeys == KEY_FIRE) {		
			if(pWorld[playerid] == WORLD_STUNT) {
				if(IsPlayerInAnyVehicle(playerid)) {
					AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
					SendClientMessage(playerid, -1, ""COL_GREY">> "COL_BLUE"SERVER "COL_GREY"<< "COL_WHITE"Your vehicle now has "COL_GREEN"NOS"COL_WHITE"!");
				}
			}
		}
		if(newkeys == KEY_FIRE && oldkeys == KEY_FIRE) {		
			if(pWorld[playerid] == WORLD_STUNT) {
				if(IsPlayerInAnyVehicle(playerid)) {
					AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
					SendClientMessage(playerid, -1, ""COL_GREY">> "COL_BLUE"SERVER "COL_GREY"<< "COL_WHITE"Your vehicle now has "COL_GREEN"NOS"COL_WHITE"!");
				}
			}
		}
		return true;
	}
Reply
#2

Use the PAWN tags next time.

Instead of

pawn Код:
if(newkeys == KEY_FIRE)
and

pawn Код:
if(oldkeys == KEY_FIRE)
replace the equal signs with a single &.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)