OnPlayerDeath
#1

Delete
Reply
#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
#3

Also the object drops fine, but there is nothing when i pick it up.
Reply
#4

Quote:
Originally Posted by Mikkel_RE
Посмотреть сообщение
Also the object drops fine, but there is nothing when i pick it up.
For your pCrack are you using a variable to store the info?
Reply
#5

Yes i am
Reply
#6

pawn Код:
DropInfo[i][dAmount][0] = PlayerInfo[playerid][pCrack] > 10;
This doesn't make sense at all. This will just save true or false in the variable.
Reply
#7

What should i do then?
Reply
#8

Check out sa-mp tutorias ****** it or make variables yourself and do it!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)