Weapon
#1

I give player weapon on spawn, when i spec someone and go off spec, i get more ammo each time, how i can solve this

and how i can solve like if player is not registered he wont get weapons,
Reply
#2

show me the spec and the spec off command. and show me the if isregistered thing.
Reply
#3

create a variable and check if player returned from spec'ing if yes he should not be given ammo but if no he should be given ammo.
Reply
#4

howv
Reply
#5

pawn Код:
// add on the top
new spec[MAX_PLAYERS];
pawn Код:
// Add on /spec command
spec[playerid] = 1;
pawn Код:
// Add on OnPlayerSpawn *the top before the Weapon Script*
if(spec[playerid] == 1) return 1;
pawn Код:
spec[playerid] = 0;
Now put on any callback/command/shit this, because this will trigger he/she didn't use /spec anymore.
Reply
#6

Just reset the player's weapons first and then give them the weapons you want (both in OnPlayerSpawn callback).
Reply
#7

What u mean o.o
Reply
#8

ResetPlayerWeapons(playerid);
Just before GivePlayerWeapon(....
Reply
#9

I mean that you can reset the weapons and then give the weapons you want so it won't add the previous ammo.
pawn Код:
public OnPlayerSpawn(playerid)
{
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, ...); // edit the weaponid and ammo

    // rest of code..
    return 1;
}
In case you use server-side weapons, you should use your custom functions.
Reply
#10

thx +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)