What's wrong in the logic of the code?
#1

This code is supposed to let the player who're class 5 or 9 ride the armed vehicles. But this isn't letting ANYONE ride them, not even a single class.

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetVehicleModel(GetPlayerVehicleID(playerid));
	if(vehicleid == 520 || vehicleid == 447 || vehicleid == 425 || vehicleid == 432)
	{
     	if(class[playerid] != 5 || class[playerid] != 9)
	    {
	        SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Your Class must be Technician or Donator to Drive Armed Vehicles.");
	        RemovePlayerFromVehicle(playerid);
	        return 1;
		}
	}
	return 1;
}
Reply
#2

Код:
class[playerid] != 5 && class[playerid] != 9
Use AND not OR!
Reply
#3

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Код:
class[playerid] != 5 && class[playerid] != 9
Use AND not OR!
Thanks, I did a noob mistake :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)