Please help me with this code
#1

Hi, i will make that when a player dies, if he got more than 10 grams in the inventory he will drop it on the ground,
Also if he got 30 grams on him, he will drop 20 grams when he die, can you please help me with the code?

I got this on OnPlayerDeath

Код:
	if(PlayerInfo[playerid][pPot] > 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;
		    	    	        GetPlayerPos(playerid, X, Y, Z);
  	                            DropInfo[i][dType] = 3;
  	                            DropInfo[i][dAmount][0] = amount;
  	                            DropInfo[i][dx] = X;
  	                            DropInfo[i][dy] = Y;
  	                            DropInfo[i][dz] = Z;
  	                            DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid);
  	                            strcpy(DropInfo[i][dPlayerName],tmp,MAX_PLAYER_NAME);
  	                            DropObject[i] = CreateObject(1578, X, Y, Z-1, 0, 0, 0, 200.0, GetPlayerVirtualWorld(playerid));
	}
Reply
#2

Create a PickUp to drop things on the ground.
Reply
#3

pawn Код:
if(PlayerInfo[playerid][pPot] > 10) { PlayerInfo[playerid][pPot] -= 10; }
else if(PlayerInfo[playerid][pPot] > 20) { PlayerInfo[playerid][pPot] -= 20; }
else if(PlayerInfo[playerid][pPot] > 30) { PlayerInfo[playerid][pPot] -= 30; }
Reply
#4

I mean more like this

Код:
	if(PlayerInfo[playerid][pPot] > 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;
		    	    	        GetPlayerPos(playerid, X, Y, Z);
  	                            DropInfo[i][dType] = 3;
  	                            DropInfo[i][dAmount][0] = amount;
  	                            DropInfo[i][dx] = X;
  	                            DropInfo[i][dy] = Y;
  	                            DropInfo[i][dz] = Z;
  	                            DropInfo[i][dWorld] = GetPlayerVirtualWorld(playerid);
  	                            strcpy(DropInfo[i][dPlayerName],tmp,MAX_PLAYER_NAME);
  	                            DropObject[i] = CreateObject(1578, X, Y, Z-1, 0, 0, 0, 200.0, GetPlayerVirtualWorld(playerid));
	}
Reply
#5

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)