13.07.2013, 15:39
hye, today i tried to create a script which would check if there is a passenger in vehicle. i have tested this script with my friend and all the time i get " there is no passenger" even if there is. so please help me to fix this.
Код:
CMD:command(playerid) { new vehicleid = GetPlayerVehicleID(playerid), passengerID = INVALID_PLAYER_ID; if(AccountInfo[playerid][Job] == JOB_TAXI) { for(new p; p < MAX_PLAYERS; p++) { if(IsPlayerInVehicle(p, 438 && 420 ) && GetPlayerState(p) == PLAYER_STATE_PASSENGER) { passengerID = p; break; } } if(passengerID == passengerID == INVALID_PLAYER_ID) { SendClientMessage(playerid, -1, "There is no passenger"); } else { SendClientMessage(playerid, -1, "There is one"); } } return true; }