IsPlayerInVehicle
#1

I make this code
PHP код:
new pc1;
new 
pc2;
new 
pc3;
new 
pc4;
new 
pc5;
new 
pc6;
new 
pc7;
new 
pc8
PHP код:
    pc1 AddStaticVehicle(448,2097.8943,-1793.3204,12.9892,88.5930,3,6);
    
pc2 AddStaticVehicle(448,2097.5974,-1794.8464,12.9886,86.0895,3,6);
    
pc3 AddStaticVehicle(448,2097.4709,-1796.3247,12.9882,88.3048,3,6);
    
pc4 AddStaticVehicle(448,2097.3459,-1797.8171,12.9878,83.3244,3,6);
    
pc5 AddStaticVehicle(448,2097.2129,-1812.4310,12.9824,89.2254,3,6);
    
pc6 AddStaticVehicle(448,2096.8552,-1814.3385,12.9822,87.6681,3,6);
    
pc7 AddStaticVehicle(448,2096.9456,-1816.5345,12.9825,88.2128,3,6);
    
pc8 AddStaticVehicle(448,2096.9509,-1818.2770,12.9833,94.1691,3,6); 
PHP код:
CMD:pizza(playeridparams[])
{
    if(
PlayerInfo[playerid][pJob] != pizza) return SendClientMessage(playeridCOLOR_RED"You are not a part from pizza company");
    if(!
IsPlayerInVehicle(playeridpc1) || !IsPlayerInVehicle(playeridpc2) || !IsPlayerInVehicle(playeridpc3) || !IsPlayerInVehicle(playeridpc4) || !IsPlayerInVehicle(playeridpc5) || !IsPlayerInVehicle(playeridpc6) || !IsPlayerInVehicle(playeridpc7) || !IsPlayerInVehicle(playeridpc8)) return SendClientMessage(playeridCOLOR_RED"You are not in any pizza's company car !");
    
cp1 CreateDynamicRaceCP(12148.9041,-1433.6654,25.5391380.4260,-1366.8895,24.00003, -1, -1playerid100.0);
    
SetPlayerMapIcon(playerid12148.9041, -1433.665425.53910COLOR_REDMAPICON_GLOBAL);
    
SendClientMessage(playeridCOLOR_ORANGE"Go to the checkpoint and deliver the pizza");
    return 
1;

But when i enter the vehicle and type pizza it tell me that i am not in any pizza's company vehicle ??
Please Help !
Reply
#2

Change all '||' to '&&'.
That is:
PHP код:
if(!IsPlayerInVehicle(playeridpc1) && !IsPlayerInVehicle(playeridpc2) && !IsPlayerInVehicle(playeridpc3) && !IsPlayerInVehicle(playeridpc4) && !IsPlayerInVehicle(playeridpc5) && !IsPlayerInVehicle(playeridpc6) && !IsPlayerInVehicle(playeridpc7) && !IsPlayerInVehicle(playeridpc8)) return SendClientMessage(playeridCOLOR_RED"You are not in any pizza's company car !"); 
Reply
#3

I always do it wrong i don't know why ?!
Reply
#4

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
I always do it wrong i don't know why ?!
Lol, it happens.
Read the last post of this: http://forum.sa-mp.com/showthread.ph...oto=nextoldest
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)