SA-MP Forums Archive
my lil death script. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: my lil death script. (/showthread.php?tid=88439)



my lil death script. - serj009 - 26.07.2009

ok heres the deal, i have this code. what its suppose to do is when you die, it will set the playerposition back to were he died and freeze the player and set an animation. Now i tried fondoling with this code for days now but now im just stuck, what happens is that the player is successfully teleported to the possision and frozen, but heres the wierd thing. on his screen he is doing the animation, but on every1 else's it just looks like hes standing. and the animation is preloaded... any ideas..?
Код:
if(MedicBill[playerid] >= 1 && PlayerInfo[playerid][pJailed] == 0 && PlayerPaintballing[playerid] == 0)//dead
		{
			new cut = PlayerInfo[playerid][pLevel]*deathcost;
			if(!IsPlayerInAnyVehicle(playerid) || IsABoat(carid) || IsAPlane(carid))
			{ SetPlayerPos(playerid,dX,dY,dZ); }
			else { SetPlayerPos(playerid,dX,dY+1.5,dZ); }
			ApplyAnimation(playerid,"CRACK","crckdeth2",4.0, 1, 1, 1, 1, 1); 	   
			SetPlayerInterior(playerid,0);
			SetPlayerVirtualWorld(playerid,0);
			GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~r~You are serverely wounded...", 35000, 3);
			PlayerInfo[playerid][pDeaths] += 1;
			PlayerDead[playerid] =1;
			PlayerDead2[playerid] =1;
			SetPlayerHealth(playerid, 1.0); 
			GivePlayerMoney(playerid, -cut);
			ResetPlayerWeapons(playerid);
			SendClientMessage(playerid,COLOR_ORANGE, "A Medic has been called. You will be helped soon.");
			new turner[MAX_PLAYER_NAME];
			new wanted[MAX_STRING];
			new wanted2[MAX_STRING];
			new string[MAX_STRING];
			GetPlayerName(playerid, turner, sizeof(turner));
			format(wanted, sizeof(wanted), "Dispatch: All Units IA: Caller: %s",turner);
			SendRadioMessage(4, TEAM_CYAN_COLOR, wanted);
			SendJobMessage(26, TEAM_CYAN_COLOR, wanted);
			format(wanted2, sizeof(wanted2), "Dispatch: Incident: Severe Injury");
			SendRadioMessage(4, TEAM_CYAN_COLOR, wanted2);
			SendJobMessage(26, TEAM_CYAN_COLOR, wanted2);
			format(string, sizeof(string), "** %s is in need of a Medic. (use /accept medic to accept the call)", turner);
			SendRadioMessage(4, TEAM_AZTECAS_COLOR, string);
			SendJobMessage(26, TEAM_CYAN_COLOR, string);
			MedicCall = playerid;
			MedicTime[playerid] = 3;
			NeedMedicTime[playerid] = 110;
			TogglePlayerControllable(playerid,0);
		  return 1;
		}



Re: my lil death script. - member - 26.07.2009

Don't know if this would work, apply the animation, clear the animation using ClearAnimations(playerid); then re-apply it, maybe that might work, or probably it'll just fail . Worth a try.