27.02.2010, 10:12
The idea is this: When the Bus driver types /viewtickets it will show him the players that have tickets inside the bus.
Код:
if (strcmp(cmd, "/viewtickets", true) == 0) { if(AccountInfo[playerid][Job] == 2 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new veh = GetPlayerVehicleID(playerid); SendClientMessage(playerid, ADMIN, "~~ Passengers Tickets ~~"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(veh == GetPlayerVehicleID(i) && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { new ticketv[24]; if(BusTicket[i] == 0) ticketv="No"; else if(BusTicket[i] == 1) ticketv="Yes"; format(string, 256, "~ %s - Ticket: %s", PlayerName(i),ticketv); SendClientMessage(playerid, WHITE, string); } } } } return 1; }