14.04.2017, 07:40
so iv made a pickup system from my server and it is good but when the player pickup pickup it checks if the pickup I created id I mean here is the code :
it is working good but is there a way to make a strock that gets the weapon id from pickup thanks.
PHP код:
for(new i = 0; i < sizeof(WeapPic); i++)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,WeapPic[i][wX],WeapPic[i][wY],WeapPic[i][wZ]))
{
if(WeapPic[i][wPickupM] == 356)
{
PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
GivePlayerWeapon(playerid, 31, WeapPic[i][wAmmo]);
}
if(WeapPic[i][wPickupM] == 358)
{
PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
GivePlayerWeapon(playerid, 34, WeapPic[i][wAmmo]);
}
if(WeapPic[i][wPickupM] == 348)
{
PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
GivePlayerWeapon(playerid, 24, WeapPic[i][wAmmo]);
}
if(WeapPic[i][wPickupM] == 1240)
{
PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
SetPlayerHealth(playerid, WeapPic[i][wAmmo]);
}
if(WeapPic[i][wPickupM] == 1242)
{
PlayerPlaySound(playerid,1150,0.0,0.0,0.0);
SetPlayerArmour(playerid, WeapPic[i][wAmmo]);
}
}
}