Wasted - 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: Wasted (
/showthread.php?tid=506038)
Wasted -
Ananisiki - 11.04.2014
I created a command where it only can be used on dead bodys but now i cant use it even if player is not dead, if player is dead it will be able to use but if he is alive and i type the command near him, it will say "no bodys close enough" or something, how i do this ?
Done something like this but it not work
pawn Code:
if(sscanf(params, "u", pID))
{
pID = GetClosestPlayer(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(pID, x ,y, z);
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
if(IsPlayerCop(pID) && GetPVarInt(pID, "Dead") == 1) format(string, sizeof string, "* %s (%d) Poops Officer %s (%d)'s Corpse.", PlayerName(playerid), playerid, PlayerName(pID), pID);
else if(!IsPlayerCop(pID) && GetPVarInt(pID, "Dead") == 1) format(string, sizeof string, "* %s (%d) Poops %s (%d)'s Corpse.", PlayerName(playerid), playerid, PlayerName(pID), pID);
Re: Wasted -
Dokins - 11.04.2014
This:
pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)
{
Should be this:
pawn Code:
if(GetPlayerState(pID) == PLAYER_STATE_WASTED)
{
You're getting your own state doing that!
Hope this helped.
Have fun!
Re: Wasted -
Ananisiki - 12.04.2014
Dont work.....
Re: Wasted -
Ananisiki - 12.04.2014
Bump
Re: Wasted -
Ananisiki - 12.04.2014
Bump
Re: Wasted -
Ananisiki - 13.04.2014
Bump
Re: Wasted -
Dokins - 13.04.2014
Actually, just realised.
There is only a second or two where a player is actually dead, that probably won't work.
Remove this line:
pawn Code:
if(GetPlayerState(pID) == PLAYER_STATE_WASTED)
{
Re: Wasted -
Ananisiki - 13.04.2014
So how about when i do this near a player who is alive? i can use it on him but i only want to use this when the player is dead, on his body
Re: Wasted -
Dokins - 13.04.2014
pawn Code:
if(IsPlayerCop(pID) && GetPVarInt(pID, "Dead") == 1)
That line checks if the player is dead. You'd need to make a death system, to force the player down for a few seconds, at least.
Re: Wasted -
Ananisiki - 13.04.2014
What do you mean

How i can do that??