14.08.2013, 14:35
Hi guys, I have a pullover command for Law Enforcement.
So I wanna stream (LOCALLY not globally) a megaphone voice FOR the suspect, how do I do it?
megaphone voice pullover link: http://mfi.re/listen/l9xh508wgr0v991/Pull_Over2.mp3
Other questions: Medic can use the pullover command. I wanna make it Law Enforcement (Cops) only. How to fix this?
Your help will be very appreciated. Thanks
Quote:
Код:
dcmd_pullover(playerid, params[]) { new string[128]; new ID; new playername[MAX_PLAYER_NAME]; new tname[MAX_PLAYER_NAME]; if(gTeam[playerid] == CIVILIAN) // To check if player is NOT Law Enforcement { SendClientMessage(playerid,COLOR_RED,"[ERROR] Only Law Enforcement Officers can use this command."); return 1; } if(sscanf(params, "u", ID)) { SendClientMessage(playerid,COLOR_RED,"[USAGE]: /pullover (PlayerName/PlayerID)"); return 1; } if(!IsPlayerConnected(ID)) // If entered wrong ID, it will send a message that u entered a wrong id. { format(string,sizeof(string),"[ERROR] The ID you entered is not connected to the server."); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(playerid == ID) // if you're asking yourself to pullover { SendClientMessage(playerid,COLOR_RED,"[ERROR] You cannot ask yourself to pullover!"); return 1; } // Removed IsSpawned GetPlayerName(playerid,playername,sizeof(playername)); GetPlayerName(ID,tname,sizeof(tname)); if(GetDistanceBetweenPlayers(playerid,ID) > 30) { format(string,sizeof(string),"[ERROR] %s(%d) is too far away to ask them to pullover.",tname,ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } if(IsPlayerInAnyVehicle(ID) == 0) // Doesnt need defining, checking if ID is not in a vehicle { format(string,sizeof(string),"[ERROR] %s(%d) must be in a vehicle in order to ask them to pullover.",tname,ID); SendClientMessage(playerid,COLOR_RED,string); return 1; } // The stage to pullover the suspect format(string,sizeof(string),"[POLICE] Law Enforcement Officer %s(%d) asked you to pullover.",playername,playerid); SendClientMessage(ID,COLOR_LIGHTBLUE,string); format(string, sizeof(string), "~b~This is SAPD, pull over your vehicle now!"); GameTextForPlayer(ID, string, 2000, 5); format(string,sizeof(string), "[POLICE] You have asked %s(%d) to pull over.",tname,ID); SendClientMessage(playerid,COLOR_LIGHTBLUE,string); return 1; } |
megaphone voice pullover link: http://mfi.re/listen/l9xh508wgr0v991/Pull_Over2.mp3
Other questions: Medic can use the pullover command. I wanna make it Law Enforcement (Cops) only. How to fix this?
Your help will be very appreciated. Thanks