02.09.2018, 08:49
PHP код:
for(new i = 0; i < MAX_PICKUPS; i++) {
if(pickupid == DropInfo[i][ID] && DropInfo[i][ID] != -1) {
SetTimerEx("Health_Timer", 10000, false, "i", playerid);
if(DropInfo[i][Type] == 1) {
new Float: HP;
GetPlayerHealth(playerid, HP);
if(HP < 90) SetPlayerHealth(playerid, HP+10);
else SetPlayerHealth(playerid, 100);
}
else {
new gunname[32];
GetWeaponName(DropInfo[i][Weapon], gunname, sizeof(gunname));
GivePlayerWeapon(playerid, DropInfo[i][Weapon], DropInfo[i][Ammo]);
}
DestroyPickup(DropInfo[i][ID]);
Delete3DTextLabel(DropInfo[i][Label]);
DropInfo[i][Type] = 0;
DropInfo[i][ID] = -1;
}
}
PHP код:
function ResetPickups() {
for(new i = 0; i < MAX_PICKUPS; i++) {
if(DropInfo[i][ID] != -1) DropInfo[i][ID] = -1;
}
return 1;
}
function DestroyPickups() {
for(new i = 0; i < MAX_PICKUPS; i++) {
if(DropInfo[i][ID] != -1) {
DestroyPickup(DropInfo[i][ID]);
DropInfo[i][Type] = 0;
DropInfo[i][ID] = -1;
}
}
return 1;
}
function drop_player_weapons(playerid, type) {
new Float: Pos[3], gunname[32], sweapon,sammo, idd, result;
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
for(new i = 0; i < 12; i++) {
GetPlayerWeaponData(playerid, i, sweapon, sammo);
if(sweapon != 0) {
result++;
idd = CheckIDEmpty();
DropInfo[idd][ID] = CreatePickup(WeaponObject(sweapon), 23, Pos[0]+result, Pos[1]+2, Pos[2], -1);
DropInfo[idd][Type] = 0;
DropInfo[idd][Weapon] = sweapon;
DropInfo[idd][Ammo] = sammo;
GetWeaponName(sweapon, gunname, sizeof(gunname));
}
}
if(activeHeal == 1 && type == 0) {
result++;
idd = CheckIDEmpty();
DropInfo[idd][ID] = CreatePickup(1240, 23, Pos[0]+result, Pos[1]+2, Pos[2], -1);
DropInfo[idd][Type] = 1;
DropInfo[idd][Weapon] = 0;
DropInfo[idd][Ammo] = 0;
}
ResetPlayerWeapons(playerid);
return 1;
}
I think
PHP код:
ResetPlayerWeapons(playerid);