SA-MP Forums Archive
Please help - 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: Please help (/showthread.php?tid=319734)



Please help - Leon01 - 20.02.2012

I have a problem in my gamemode:
When i'm a cop and I kill a player with wanted level which has a house/rent, he goes in his house instead of jail, but if he doesn't have a house/rent he goes to jail.
This is the command:
Код:
	if(newstate == PLAYER_STATE_WASTED)
	{
		if(WantedLevel[playerid] >= 1)
		{
		    new price = WantedLevel[playerid] * 500;
			new count;
			for(new i = 0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
				    if(gTeam[i] == 2 && CrimInRange(30.0, playerid,i))
				    {
						count = 1;
						format(string, sizeof(string), "~w~Running Suspect~r~Killed~n~Bonus~g~$%d", price);
						GameTextForPlayer(i, string, 5000, 1);
						ConsumingMoney[i] = 1;
						GivePlayerMoney(i, price / 2);
						PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
					}
				}
			}
			if(count == 1)
			{
				GivePlayerMoney(playerid, - price);
				PlayerInfo[playerid][pWantedDeaths] += 1;
				PlayerInfo[playerid][pJailed] = 1;
			    PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
			    format(string, sizeof(string), "* You are in Jail for %d Seconds and lose $%d because of running away and getting shot by the Officer.", PlayerInfo[playerid][pJailTime], price);
			    SendClientMessage(playerid, COLOR_LIGHTRED, string);
			    WantedPoints[playerid] = 0;
				WantedLevel[playerid] = 0;
			}
		}
	}
Please help.


Re: Please help - milanosie - 20.02.2012

It is something with ur OnPlayerSpawn