IsPlayerInVehicle
#1

Hey,

Can Anyone Help me how can i add more than one vehicle id here :-
Код:
if(IsPlayerInVehicle(playerid, 519)) return SendClientMessage(playerid,-1,"You must be in a Plane to Do Work");
and how to fix this error :-
Код:
C:\DOCUME~1\User\Desktop\Server\GAMEMO~1\aviator.pwn(1278) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
My Line :-
Код:
{
else
}
Please.
Reply
#2

pawn Код:
if(IsPlayerInVehicle(playerid,(519 || 520))) return SendClientMessage(playerid,-1,"You must be in a Plane to Do Work");
think that should work
*
Reply
#3

Quote:
Originally Posted by dusk
Посмотреть сообщение
pawn Код:
if(IsPlayerInVehicle(playerid,(519 || 520))) return SendClientMessage(playerid,-1,"You must be in a Plane to Do Work");
think that should work
*
That will not work.

You can use the OR operator !
pawn Код:
if( IsPlayerInVehicle(playerid, some_vehicle_id) || IsPlayerInVehicle(playerid, another_vehicle_id) || ...) return --;
About the 2nd part, why are you using else if there's no code there?
Reply
#4

it have :-
Код:
{
else
}
if(IsPlayerInVehicle(playerid, 519) || IsPlayerInVehicle(playerid, 593)) return SendClientMessage(playerid,-1,"You must be in a Plane to Do Work");
Reply
#5

Quote:
Originally Posted by Thour57
Посмотреть сообщение
it have :-
Код:
{
else
}
if(IsPlayerInVehicle(playerid, 519) || IsPlayerInVehicle(playerid, 593)) return SendClientMessage(playerid,-1,"You must be in a Plane to Do Work");
Woh! this is something curious.You have to use else like this

pawn Код:
if(condition)
{
//codes
}
else
{
//codes
}
Ur format is wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)