29.05.2010, 23:39
Hey Guys
Now i wanted to make something to drop the players weapons who died.
so another could pick em up and they are away...
my code is like this:
I know its not very nice scripted, but i really dont know how to get it.
Now i wanted to make something to drop the players weapons who died.
so another could pick em up and they are away...
my code is like this:
pawn Код:
#define PLAYER_WEAPONS 1
new gPlayerWeapons[2][2];
// ---------
public OnPlayerDeath(playerid, killerid, reason)
{
new WeaponPickup;
new Float:PlayerPosX;
new Float:PlayerPosY;
new Float:PlayerPosZ;
GetPlayerPos(playerid, PlayerPosX, PlayerPosY,PlayerPosZ);
gPlayerWeapons[][] = GetPlayerWeapon(playerid);
WeaponPickup = CreatePickup(1240, 3, PlayerPosX, PlayerPosY, PlayerPosZ);
return 1;
}
// --------
public OnPlayerPickupPickup(playerid, pickupid)
{
if (pickupid == PLAYER_WEAPONS)
{
for (new i=0; i<=2; i++)
{
GivePlayerWeapon(playerid, gPlayerWeapons[i][], gPlayerWeapons[][i]);
}
}
return 1;
}
I know its not very nice scripted, but i really dont know how to get it.