Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define color_yellow 0xFFFF00AA
- new tracedid;
- new pDetective[MAX_PLAYERS];
- new pLocating[MAX_PLAYERS]
- dcmd(locate, 6, cmdtext);
- dcmd(locateoff, 9, cmdtext);
- dcmd_locate(playerid, input[])
- {
- if(GetPlayerColor(playerid) == color_green )
- {
- if(pDetective[playerid] == 1)
- {
- if(pLocating[playerid] == 0)
- new Float:x, Float:y, Float:z;
- pLocating[playerid] = 1 // Shows if the player is locating a player or not
- if(sscanf(input, "u", id)) return SendClientMessage(playerid, color_grey, "Usage: /locate [id]");
- GetPlayerPos(id, x, y, z);
- GivePlayerMoney(playerid, -500); // Player pays 500 dollars to use this command each time
- SetPlayerMarkerForPlayer(playerid, tracedid, color_yellow);
- SendClientMessage(playerid, color_yellow, "[Computer]: Target has been marked. To kill radar, use /locateoff");
- }
- else
- {
- SendClientMessage(playerid, color_yellow, "[Computer]: You are already tracing someone.");
- }
- else
- {
- GameTextForPlayer(playerid, "~r~You are not a military member", 3000, 5);
- }
- }
- return 1;
- }
- dcmd_locateoff(playerid, input[])
- {
- if(GetPlayerColor(playerid) == color_green )
- {
- if(pDetective[playerid] == 1)
- {
- if(pLocating[playerid] == 1)
- {
- SetMarketForPlayer(playerid, tracedid, 0xFFFFFF00); // taking off the tracer
- SendClientMessage(playerid, color_yellow, "[Computer]: You killed the location-mark on target.");
- pLocating[playerid] = 0
- }
- else
- {
- SendClientMessage(playerid, color_yellow, "[Computer]: You currently do not trace anyone.");
- }
- else
- {
- SendClientMessage(playerid, color_red, "* You are not a detective! *");
- }
- else
- {
- SendclientMessage(playerid, color_red, "* You are not a Military member. *");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment