18.03.2013, 00:09
The reason is that you reset all the values before even giving the weapon to the player.
Try this:
Try this:
pawn Код:
CMD:recojerarma(playerid, params[])
{
new string[128];
new playername[MAX_PLAYER_NAME];
new DropObject[MAX_DROP_ITEMS];
for(new i = 0; i < sizeof(DropInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunVWorld])
{
GetPlayerName(playerid, playername, sizeof(playername));
DestroyDynamicObject(DropObject[i]);
GiveZaiatWeapon(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
DropInfo[i][DropGunPosX] = 0.0;
DropInfo[i][DropGunPosY] = 0.0;
DropInfo[i][DropGunPosZ] = 0.0;
DropInfo[i][DropGunAmmount][0] = 0;
DropInfo[i][DropGunAmmount][1] = 0;
format(string, sizeof(string), "* %s recoje el arma del suelo.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
}
}
return 1;
}