SA-MP Forums Archive
Help wanted - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help wanted (/showthread.php?tid=501173)



Help wanted - KiLLeR11222 - 16.03.2014

1. I have command /jail if I give command/jail 0 0 at the stars wanted to trigger the remains disappear wanted level 10 and wanted-remains active because they cannot use any commands so they remain with wanted.
2. In order to appear as robbank 10 stars it's alright if you put SetPlayerWantedLevel: function (giveplayerid, 10);?
3. When I enter the server automatically gives me wanted I see 1-2 stars.

Код:
	if(strcmp(cmd, "/jail", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/PartOfName] [time(minutes)]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 2)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
				        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, sizeof(string), "* You Jailed %s.", giveplayer);
						SendClientMessage(playerid, COLOR_LIGHTRED, string);
						format(string, sizeof(string), "* You were Jailed by Admin %s.", sendername);
						SendClientMessage(playa, COLOR_LIGHTRED, string);
						ResetPlayerWeapons(playa);
						WantedPoints[playa] = 0;
						PlayerInfo[playa][pJailed] = 1;
						PlayerInfo[playa][pJailTime] = money*60;
						SetPlayerInterior(playa, 6);
						SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
						format(string, sizeof(string), "You are jailed for %d minutes.   Bail: Unable", money);
                        SetPlayerWantedLevel(giveplayerid, 0);
						SendClientMessage(playa, COLOR_LIGHTBLUE, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}