[Help]Command /su /cuff
#1

How can i set that i cant cuff a player if he doesn't have wanted level, and that i can't cuff him if he is not tased..

Here is my cuff command:

Код:
	if(strcmp(cmd, "/cuff", true) == 0 || strcmp(cmd, "/stavilisice", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(gTeam[playerid] == 2 || IsACop(playerid))
			{
				if(KnockedDown[playerid] == 1)
				{
					SendClientMessage(playerid, COLOR_GREY, "Ne mozete zamahnuti kada ste vec oboreni.");
					return 1;
				}
				if(PlayerTied[playerid] == 1)
				{
					SendClientMessage(playerid, COLOR_GREY, "   Vezani ste!");
					return 1;
				}
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /stavilisice [ID Igraca/Dio Imena]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
			    if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
				        if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
				        {
				            SendClientMessage(playerid, COLOR_GREY, "   Ne mozete staviti lisice Policajcu!");
					        return 1;
				        }
					    if(PlayerCuffed[giveplayerid] > 1)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "   Igracu su vec stavljene lisice !");
					        return 1;
					    }
						if (ProxDetectorS(3.0, playerid, giveplayerid))
						{
						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete staviti lisice sebi!"); return 1; }
						    {
						        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
						        format(string, sizeof(string), "* %s vam je stavio lisice.", sendername);
								SendClientMessage(giveplayerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* Stavili ste lisice %s-u.", giveplayer);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* %s stavlja lisice %s-u.", sendername ,giveplayer);
								ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
								GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3);
								TogglePlayerControllable(giveplayerid, 0);
								PlayerCuffed[giveplayerid] = 2;
								PlayerCuffedTime[giveplayerid] = 99999999999999;
						    }

						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "   Taj igrac nije blizu vas !");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   Igrac je offline !");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / FBI / SWAT !");
			}
		}
		return 1;
	}
Here is command for check for taser: if(PlayerInfo[playerid][pTazovan] == 1)

And here is /su command ,pls just copy me here doned code and describe me what you do ,because im begginer,thanks alot :P

/SU

Код:
	if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 3 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 3) { }
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
			    return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (gTeam[playerid] == 2 || IsACop(playerid))
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						if (gTeam[giveplayerid] != 2)
						{
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							new length = strlen(cmdtext);
							while ((idx < length) && (cmdtext[idx] <= ' '))
							{
								idx++;
							}
							new offset = idx;
							new result[64];
							while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
							{
								result[idx - offset] = cmdtext[idx];
								idx++;
							}
							result[idx - offset] = EOS;
							if(!strlen(result))
							{
								SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
								return 1;
							}
							if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
							else { WantedPoints[giveplayerid]+= 2; }
							SetPlayerCriminalEx(giveplayerid,playerid, result);
							return 1;
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
						}
					}
				}
				else
				{
						format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
						SendClientMessage(playerid, COLOR_GRAD1, string);
						return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
			}
		}
		return 1;
	}
AND FOR END if u can say me how to make when player have wanted level ,his name is RED when you see him and on SCOREBOARD ,I hope you understand and help me ,thanks alot!
Reply
#2

Try this for your /cuff command.

pawn Код:
if(strcmp(cmd, "/cuff", true) == 0 || strcmp(cmd, "/stavilisice", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gTeam[playerid] == 2 || IsACop(playerid))
            {
                if(KnockedDown[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "Ne mozete zamahnuti kada ste vec oboreni.");
                    return 1;
                }
                if(PlayerTied[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Vezani ste!");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp)) {
                    SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /stavilisice [ID Igraca/Dio Imena]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   Ne mozete staviti lisice Policajcu!");
                            return 1;
                        }
                        if(PlayerCuffed[giveplayerid] > 1)
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   Igracu su vec stavljene lisice !");
                            return 1;
                        }
                        // Changes Begin.
                        if(GetPlayerWantedLevel(giveplayerid) <= 0) // This will make it give an error if the playerid's wanted level is 0 or lower.
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   This player is not wanted!");
                            return 1;
                        }
                        if(PlayerInfo[giveplayerid][pTazovan] != 1) // This will give an error if the playerid is not tazed.
                        {
                            SendClientMessage(playerid, COLOR_GREY, "    That player is not tazed!");
                            return 1;
                        }
                        // Changes End.
                        if (ProxDetectorS(3.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete staviti lisice sebi!"); return 1; }
                            {
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, sizeof(string), "* %s vam je stavio lisice.", sendername);
                                SendClientMessage(giveplayerid, COLOR_WHITE, string);
                                format(string, sizeof(string), "* Stavili ste lisice %s-u.", giveplayer);
                                SendClientMessage(playerid, COLOR_WHITE, string);
                                format(string, sizeof(string), "* %s stavlja lisice %s-u.", sendername ,giveplayer);
                                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3);
                                TogglePlayerControllable(giveplayerid, 0);
                                PlayerCuffed[giveplayerid] = 2;
                                PlayerCuffedTime[giveplayerid] = 99999999999999;
                            }

                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   Taj igrac nije blizu vas !");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Igrac je offline !");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Niste Policajac / FBI / SWAT !");
            }
        }
        return 1;
    }
Reply
#3

Ahh all work but for wanted not ,I give him wanted and server say that player dont have wanted :P And if you can give me when i give someone wanted he is red on scoreboard and on street ..TY
Reply
#4

When you have him the wanted level, did you use SetPlayerWantedLevel?
Reply
#5

You think command /suspect ,hmm I have better way ,I make that for tazer to you cant cuff if you are not tazed,that works,now i have better idea ,to not add that if you dont have wanted lvl you cant cuff,better if you dont have wanted level you cant be tazed I hope you understand me ,here is my taser command:

http://pastebin.com/jefaLM4e
Reply
#6

SR : Ajde brate objasni na srpskom jebote sta si napisao nista te ne razumem :S

EN : Wrote this on serbian , i don't understand you :S


I will help him , i just don't understand this
Quote:

You think command /suspect ,hmm I have better way ,I make that for tazer to you cant cuff if you are not tazed,that works,now i have better idea ,to not add that if you dont have wanted lvl you cant cuff,better if you dont have wanted level you cant be tazed I hope you understand me ,here is my taser command

XD
Reply
#7

Kontam da je bolje da napravim onda da ne mozes nekog tazovati ako nema wanted lvl,i kako da namestim da kad ima wanted lvl da je crven na score tabeli i kad ga sretnem na ulici ,kontas? Jebem ti engleski haha
Reply
#8

BUMP
Reply
#9

SR : Daj mi tazer komandu

EN : Give me tazer Command
Reply
#10

HEERE

http://pastebin.com/saYdj0zd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)