OnPlayerDeath
#2

Quote:
Originally Posted by Mikkel_RE
Посмотреть сообщение
Hi i have this on OnPlayerDeath, and i want that when a player dies he will drop the crack if he got more than 10 grams in his inventory, but when i die the object drops, but when i try to pick it up it says there's just 0 grams.

Код:
	if(PlayerInfo[playerid][pCrack] > 10)
	{
	    PlayerInfo[playerid][pCrack] = 10;
		for(new i = 0; i < sizeof(DropInfo); i++)
  	    {
  	        if(DropInfo[i][dx] == 0.0 && DropInfo[i][dy] == 0.0 && DropInfo[i][dz] == 0.0)
  	        {
  	            new Float:X,Float:Y,Float:Z;
  	            new rpos[2];
		    	GetPlayerPos(playerid, X, Y, Z);
  	            DropInfo[i][dType] = 2;
  	            DropInfo[i][dAmount][0] = PlayerInfo[playerid][pCrack] > 10;
  	            DropInfo[i][dx] = X;
  	            DropInfo[i][dy] = Y;
  	            DropInfo[i][dz] = Z;
  	            rpos[0] = random(4), rpos[1] = random(4);
  	            DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid);
  	            DropObject[i] = CreateObject(1575,  X + rpos[0], Y + rpos[1], Z, GetPlayerVirtualWorld(playerid));
  	        }
  	    }
  	}
CreatePickup(Model, Type, Float:X, Float:Y, Float:Z, 0)
Get the players death co-ords
Also do a new loop to check if the crack has been picked up, if yes then RemovePickup
Reply


Messages In This Thread
Delete, this one was wrong. - by Mikkel_RE - 02.12.2012, 11:06
Re: OnPlayerDeath - by Lz - 02.12.2012, 11:20
Re: OnPlayerDeath - by Mikkel_RE - 02.12.2012, 11:33
Re: OnPlayerDeath - by Lz - 02.12.2012, 12:14
Re: OnPlayerDeath - by Mikkel_RE - 02.12.2012, 13:12
Re: OnPlayerDeath - by Vince - 02.12.2012, 13:15
Re: OnPlayerDeath - by Mikkel_RE - 02.12.2012, 13:36
Re: OnPlayerDeath - by Nirzor - 02.12.2012, 13:44

Forum Jump:


Users browsing this thread: 2 Guest(s)