About weapons :D (I will repp+)
#1

Is it possible or is there a weapon that does not reload bullets? If so ... tell me how
I will repp+
Reply
#2

I think you should add
pawn Код:
GivePlayerWeapon(playerid, ID, AMMO);
under OnPlayerUpdate, try that, it should work
Reply
#3

Keep on giving ammo to the player on a repeating timer. I'm not sure whether it might create a break while shooting continuously.
pawn Код:
new bool:p_Spawned[MAX_PLAYERS]; //To clarify whether player is spawned or not.
public OnPlayerConnect(playerid)
{
 p_Spawned[playerid] = false;
 return 1;
}

public OnPlayerSpawn(playerid)
{
 p_Spawned[playerid] = true;
 return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
 p_Spawned[playerid] = false;
 return 1;
}

public OnFilterScriptInit()
{
 SetTimer("NoReload_", 350, true); //Depends on the sync or fire rate, not sure if this timer could work perfectly. In some cases, no reload might not work well.
 return 1;
}

forward NoReload_();
public NoReload_()
{
 for(new i; i< GetMaxPlayers(); i++)
 {
  if(!IsPlayerConnected(i)) continue;
  if(p_Spawned[i] != 1) continue;
  GivePlayerWeapon(i, GetPlayerWeapon(i), 1000);
 }
 return 1;
}
Not sure about this as I haven't tested, but something like this is so.
Reply
#4

Create a repeating timer, I recommend using a 300-500 ms interval.
inside the timer, check the player ammo, if it's less than the max ammo, set his ammo to the max one (the long part is creating conditions for each gun, considering that not all guns have the same max ammo value, ex: deagle's is 7, spas is 12 or something, I'm not sure but you get the point)
https://sampwiki.blast.hk/wiki/GetPlayerAmmo
https://sampwiki.blast.hk/wiki/SetPlayerAmmo
Reply
#5

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Keep on giving ammo to the player on a repeating timer. I'm not sure whether it might create a break while shooting continuously.
pawn Код:
new bool:p_Spawned[MAX_PLAYERS]; //To clarify whether player is spawned or not.
public OnPlayerConnect(playerid)
{
 p_Spawned[playerid] = false;
 return 1;
}

public OnPlayerSpawn(playerid)
{
 p_Spawned[playerid] = true;
 return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
 p_Spawned[playerid] = false;
 return 1;
}

public OnFilterScriptInit()
{
 SetTimer("NoReload_", 350, true); //Depends on the sync or fire rate, not sure if this timer could work perfectly. In some cases, no reload might not work well.
 return 1;
}

forward NoReload_();
public NoReload_()
{
 for(new i; i< GetMaxPlayers(); i++)
 {
  if(!IsPlayerConnected(i)) continue;
  if(p_Spawned[i] != 1) continue;
  GivePlayerWeapon(i, GetPlayerWeapon(i), 1000);
 }
 return 1;
}
Not sure about this as I haven't tested, but something like this is so.
thxx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)