SA-MP Forums Archive
help with GM - 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 with GM (/showthread.php?tid=293236)



help with GM - DerViL - 27.10.2011

Hi. I downloaded GM Los Angeles Life but there is one bug, when i die i get to hostipal but i can get out it always shows me that i have to rest and i waited like 20 minutes... If someone knows how to fix it please tell me


Re: help with GM - anantanni - 27.10.2011

Why don't you try posting the code.. OnPlayerDeath.


Re: help with GM - DerViL - 27.10.2011

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new name[MAX_PLAYER_NAME];
	new string[256];
	//new dmessage[128];
	//new deathreason[20];
	new playercash;
	new victimteam;
	new Float:px,Float:py,Float:pz;
	new killerteam;

	victimteam = gTeam[playerid];
	killerteam = gTeam[killerid];
	gPlayerSpawned[playerid] = 0;
	PlayerInfo[playerid][pInvWeapon] = 0;
 	PlayerInfo[playerid][pInvAmmo] = 0;
	GetPlayerName(playerid, name, sizeof(name));
	PlayerInfo[playerid][pLocal] = 255;
	GetPlayerPos(playerid, px, py, pz);
	if(killerid != 255)
	{
		if(GetPlayerState(killerid) == 2)
		{
		    if(ProxDetectorS(20, killerid, playerid))
		    {
		        if(!IsPlayerInAnyVehicle(playerid))
		        {
					if(PlayerInfo[killerid][pMember] == 1||PlayerInfo[killerid][pLeader] == 1||PlayerInfo[killerid][pMember] == 2||PlayerInfo[killerid][pLeader] ==2)
		    		{
		    		    SendClientMessage(killerid, COLOR_YELLOW, "That was a drive-by kill. Don't abuse it.");
						return 1;
					}
					SetPlayerCriminal(killerid,255,"Manslaughter");
					SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
					return 1;
				}
			}
		}
	}
	if (PlayerInfo[killerid][pAdmin] < 1)
	{
		if(reason == 38)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a [%d]%s with minigun.",killerid,kickname,playerid,name);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
				//Ban(killerid);
			}
		}
		if(reason == 35)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with a flamethrower and has been IP banned.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
				Ban(killerid);
			}
		}
		if(reason == 9)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with a chainsaw and has been IP banned.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
				Ban(killerid);
			}
		}
		if(reason == 16)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with grenades and has been IP banned.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
				Ban(killerid);
			}
		}
		if(reason == 18)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with molotovs and has been IP banned.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
				Ban(killerid);
			}
		}
		if(reason == 28)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with a Mac 10, Check him immediately.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
			}
		}
		if(reason == 32)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with Tec 9's, Check him immediately.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
			}
		}
		if(reason == 36)
		{
			new kstring[128];
			new kickname[MAX_PLAYER_NAME];
			if(IsPlayerConnected(killerid))
			{
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "AdmWarning: [%d]%s just killed a player with a Lock On Launcher and has been IP banned.",killerid,kickname);
				ABroadCast(COLOR_LIGHTRED,string,1);
				printf("%s", kstring);
				Ban(killerid);
			}
		}
	}
	if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
	{
		DisablePlayerCheckpoint(playerid);
		gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
	}
	new caller = Mobile[playerid];
	if(caller != 255)
	{
		if(caller < 255)
		{
			SendClientMessage(caller,  COLOR_GRAD2, "   The line just went dead....");
			CellTime[caller] = 0;
			CellTime[playerid] = 0;
			Mobile[caller] = 255;
		}
		Mobile[playerid] = 255;
		CellTime[playerid] = 0;
	}
	ClearCrime(playerid);
	if(PlayerPaintballing[playerid] != 0)
	{
	    PlayerPaintballKills[killerid] ++;
	    if(PlayerPaintballKills[killerid] > PaintballWinnerKills)
	    {
	        new killer[MAX_PLAYER_NAME];
	        PaintballWinner = killerid;
	        PaintballWinnerKills = PlayerPaintballKills[killerid];
	        GetPlayerName(killerid, killer, sizeof(killer));
	        for(new i = 0; i < MAX_PLAYERS; i++)
	        {
	            if(IsPlayerConnected(i))
	            {
	                if(PlayerPaintballing[i] != 0)
	                {
	                    format(string, sizeof(string), "* %s is in the lead with %d Kills.",killer,PaintballWinnerKills);
						SendClientMessage(i, COLOR_WHITE, string);
	                }
	            }
	        }
	    }
	    return 1;
	}
	if(GettingCK[playerid] < 999)
	{
	    if(IsPlayerConnected(killerid))
	    {
	        if(OnCK[killerid] < 999)
	        {
	            new killer[MAX_PLAYER_NAME];
	            new dier[MAX_PLAYER_NAME];
	            GetPlayerName(playerid, dier, sizeof(dier));
				GetPlayerName(killerid, killer, sizeof(killer));
	            format(string, sizeof(string), "* %s has performed a Character Kill on you, you aren't able to play with this Character anymore.",killer);
	            SendClientMessage(playerid, COLOR_LIGHTRED, string);
	            format(string, sizeof(string), "** %s has Character Killed %s **",killer,dier);
	            CKLog(string);
	            BroadCast(COLOR_LIGHTRED, string);
	            PlayerInfo[playerid][pCK] = 1;
	            if(GettingCK[playerid] < 999) { GettingCK[playerid] = 999; }
	            else if(OnCK[playerid] < 999) { OnCK[playerid] = 999; }
	            if(GettingCK[killerid] < 999) { GettingCK[killerid] = 999; }
	            else if(OnCK[killerid] < 999) { OnCK[killerid] = 999; }
	            KickPlayer[playerid] = 1;
	        }
	    }
	}
	if(PlayerInfo[playerid][pHeadValue] > 0)
	{
	    if(IsPlayerConnected(killerid))
	    {
		    if(gTeam[killerid] == 10 || PlayerInfo[killerid][pLeader] == 8)
		    {
		        if(GoChase[killerid] == playerid)
		        {
This One??


Re: help with GM - jonrb - 27.10.2011

That appears to be missing some code.


Re: help with GM - DerViL - 27.10.2011

Maybe i should copy the whole .pwn code here?


Re: help with GM - jonrb - 27.10.2011

Just having the entire OnPlayerDeath should be enough.

P.S maybe search for "1200000" (20 minutes in milliseconds) and "1200" (20 minutes in seconds) in your code... You might find the timer like that


Re: help with GM - DerViL - 27.10.2011

There are somekinda timers but they not for Death or Hospital only for Burger Shot and something else... Maybe you could fix this code?

EDIT: And where can i download illegal jobs system, this one sucks?!

EDIT2: Maybe picture will help http://imageshack.us/photo/my-images/811/samp002sbv.png


Re: help with GM - DerViL - 28.10.2011

Will someone help me?? :/


Re: help with GM - iNorton - 28.10.2011

You can't "download" illegal jobs you have to script them.
Or at least spend a day in Filter Script section and look

When you die, show me what is says to a player, if it will give a text "You have to be in hospital for 20 min bla bla bla" the timer might be where SendClientMessage


Re: help with GM - DerViL - 28.10.2011

Quote:
Originally Posted by iNorton
Посмотреть сообщение
You can't "download" illegal jobs you have to script them.
Or at least spend a day in Filter Script section and look

When you die, show me what is says to a player, if it will give a text "You have to be in hospital for 20 min bla bla bla" the timer might be where SendClientMessage
Heres an image, what it shows when i get to hospital http://imageshack.us/photo/my-images/811/samp002sbv.png

And i changed the time to be on hospital on 10 seconds and every 10 seconds it shows Doctor: Medical.... Like on picture!