23.03.2012, 16:11
My Pickups are all messed up. I'm going to copy the code here. I've been struggling with this problem for a few days now and I still can't figure it out. Please help me.
My problem is with the pickup "Elud". The pickup creates when you kill someone. When I'm trying to pick up the "Elud" pickup then the cashbox string shows up. They're kinda messed up.
+REP to the person who helps me out!
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
Elud = CreatePickup(1240,1, X, Y, Z, -1);
if(playerid == CashboxOwner)
{
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, CashboxX, CashboxY, CashboxZ);
GetPlayerName(playerid, pName, sizeof(pName));
format(str, 128, "Cashbox owner %s (ID: %d) died and he dropped his cashbox", pName, playerid);
DisablePlayerCheckpoint(playerid);
SendClientMessageToAll(0xFFD700AA, str);
CashboxPickup = CreatePickup(1210, 3, CashboxX, CashboxY, CashboxZ);
CashboxOwner = INVALID_PLAYER_ID;
if(mode == 1)
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerCheckpoint(i, CashboxX, CashboxY, CashboxZ, 1);
}
}
}
}
return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == CashboxPickup)
{
PlayerPlaySound(playerid, 1150, 0, 0, 0);
new str[128], pName[MAX_PLAYER_NAME];
DestroyPickup(CashboxPickup);
IsCashboxPickedUp = 1;
CashboxOwner = playerid;
GetPlayerName(playerid, pName, sizeof(pName));
format(str, 128, "%s picked up the cashbox. Kill him before he reaches the droplocation.", pName);
SendClientMessageToAll(0xFFD700AA, str);
if(mode == 1)
{
for(new i; i<MAX_PLAYERS; i++)
{
DisablePlayerCheckpoint(i);
}
}
SetPlayerCheckpoint(playerid, DropLocation[0], DropLocation[1], DropLocation[2], 3);
}
if(pickupid == Elud)
{
SetPlayerHealth(playerid,100);
}
return 1;
}
+REP to the person who helps me out!