29.03.2017, 19:25
i got most of it working except it sends the message to everybody who is in a vehicle instead of just theirs
i just dont know how to get it to grab the vehicles ID and limit the messages to that vehicle only
help is appreciated my mens
i just dont know how to get it to grab the vehicles ID and limit the messages to that vehicle only
Код:
forward SendCarMessage(color, string[]); public SendCarMessage(color, string[]) { for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { if(IsPlayerInVehicle(i, GetPlayerVehicleID(i))) { SendClientMessage(i, color, string); } } } }
Код:
CMD:carwhisper(playerid, params[] ) { new string[128]; if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /cw [message]"); if(IsPlayerInAnyVehicle(playerid) == 0) return SendClientMessage(playerid, -1, "You are not in any vehicle."); { if(IsPlayerInAnyVehicle(playerid) == 1) GetPlayerVehicleID(playerid); format(string, sizeof(string), "%s whispers: %s", GetName(playerid), params); SendCarMessage(COLOR_YELLOW, string); format(string, sizeof(string), "%s mutters something.", GetName(playerid)); SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 5.0, 4000); } return 1; }