15.07.2016, 15:29
You are using a forloop
PHP код:
dcmd_pickup(playerid, params[])
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerInRangeOfPoint(i, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
{
if(GetPlayerVirtualWorld(i) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(i) == DropInfo[i][DropGunVWorld])
{
new sendername[MAX_PLAYER_NAME];
GetPlayerRPName(playerid, sendername, sizeof(sendername));
DestroyDynamicObject(DropObject[i]);
GivePlayerWeaponEx(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 picks up a weapon.", sendername);
SendLocalMessage(playerid, string, 10.0, COLOR_ACTION, COLOR_ACTION);
return 1;
}
}
}
return 1;
}