Help with player message script
#1

I have attempted to write a script so that when a cop enters /rights [playername] it will display Miranda rights to that player only before being arrested.

When I type /rights playername all I get displayed is

Код:
Usage: /rights (playerid)
I'm starting to struggle here as it just won't work, even though I'm a leader of the SAPD faction and I have searched and searched the forums for answers.

When I complied the script, I got no errors.

Thanks in advance if anybody can help me on this and I hope I make sense

Код:
if(strcmp(cmd, "/rights", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gTeam[playerid] != 2)
			{
			    SendClientMessage(playerid, COLOR_GREY, "** You are not a Cop!");
			    return 1;
			}
			if(PlayerInfo[playerid][pDBanned] == 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "** You are Banned From Cop Duty!");
			    return 1;
			}
	        if(PlayerInfo[playerid][pDuty] != 1 && PlayerInfo[playerid][pMember] == 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "** You are not on Duty!");
			    return 1;
			}
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Usage: /rights (playerid)");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Usage: /rights (playerid)");
				return 1;
			}
			moneys = strval(tmp);

			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if (ProxDetectorS(8.0, playerid, giveplayerid))
					{
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

      					//if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Usage: /rights (playerid)");
      					SendClientMessage(playerid, COLOR_RED, "Usage: /rights (playerid)");
						SendClientMessage(playerid, COLOR_RED, "Your rights: bla bla bla bla");
						SendClientMessage(playerid, COLOR_RED, " rights continue bla bla bla");

						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_GREY, "** That player is not near you !");
						return 1;
					}
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "** That player is Offline !");
			    return 1;
			}
		}
		return 1;
	}
Reply
#2

I ask why not just make a bind for it using a keybinder such as "Chaos AD Keybinder"
Reply
#3

Quote:
Originally Posted by Darklom
Посмотреть сообщение
I ask why not just make a bind for it using a keybinder such as "Chaos AD Keybinder"
because then everyone who is a cop would have to go and download that and remember the bind.

On Topic:

I like your idea. I will try to help you if I can. I am reviewing your script and will do some tests and get back with ya!
Reply
#4

Quote:
Originally Posted by Kevin_Joshen
Посмотреть сообщение
I like your idea. I will try to help you if I can. I am reviewing your script and will do some tests and get back with ya!
Thanks mate cause I'm totally baffled with this one !!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)