17.06.2008, 05:21
IsAnyTrailerAttachedToVehicle
Returns 1 when a trailer is attacked to the vehicle, 0 otherwise.
GetPlayersInVehicle
This function simpely returns the amount players in a vehicle. (0 if it is empty)
Returns 1 when a trailer is attacked to the vehicle, 0 otherwise.
Code:
IsAnyTrailerAttachedToVehicle(vehicleid) { new trailerid = GetVehicleTrailer(vehicleid); new modelid = GetVehicleModel(trailerid); if(modelid == 435 || modelid == 450 || modelid == 591 || modelid == 606 || modelid == 607 || modelid == 610 || modelid == 569 || modelid == 590 || modelid == 584 || modelid == 570 || modelid == 608 || modelid == 611) return true; return false; }
This function simpely returns the amount players in a vehicle. (0 if it is empty)
Code:
GetPlayersInVehicle(vehicleid) { new amount = 0; for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i) || !IsPlayerInVehicle(i,vehicleid)) continue; amount++; } return amount; }