SA-MP Forums Archive
After i die i get weapons. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: After i die i get weapons. (/showthread.php?tid=557811)



After i die i get weapons. - Glossy42O - 15.01.2015

Like the title says.

PHP код:
  if(GetPlayerTeam(playerid) == TEAM_GROVE)
  {
    
GivePlayerWeapon(playerid24,90);
    
GivePlayerWeapon(playerid25,100);
    
GivePlayerWeapon(playerid31,200);
    return 
1;
  }
  if(
GetPlayerTeam(playerid) == TEAM_BALLAS)
  {
    
GivePlayerWeapon(playerid24,100);
    
GivePlayerWeapon(playerid27,50);
    
GivePlayerWeapon(playerid29,200);
    return 
1;
  }
  if(
GetPlayerTeam(playerid) == TEAM_VAGOS)
  {
     
GivePlayerWeapon(playerid24,90);
    
GivePlayerWeapon(playerid25,100);
    
GivePlayerWeapon(playerid31,200);
    return 
1;
  }
  if(
GetPlayerTeam(playerid) == TEAM_HOBOS)
  {
     
GivePlayerWeapon(playerid24,70);
    
GivePlayerWeapon(playerid27,100);
    
GivePlayerWeapon(playerid34,200);
    
GivePlayerWeapon(playerid34,50);
    return 
1;
  }
  if(
GetPlayerTeam(playerid) == TEAM_COPS)
  {
     
GivePlayerWeapon(playerid24,90);
    
GivePlayerWeapon(playerid25,100);
    
GivePlayerWeapon(playerid31,200);
    return 
1;
  }
  if(
GetPlayerTeam(playerid) == TEAM_CHINESE)
  {
     
GivePlayerWeapon(playerid24,90);
    
GivePlayerWeapon(playerid27,100);
    
GivePlayerWeapon(playerid31,200);
    
GivePlayerWeapon(playerid32,200);
    return 
1;
  } 



Re: After i die i get weapons. - nezo2001 - 15.01.2015

If you want when you die remove your weapons type under onplayerdeath
PHP код:
ResetPlayerWeapons(playerid); 



Re: After i die i get weapons. - Glossy42O - 15.01.2015

no no, When i connect i spawn i got no weapons but if i die and spawn again i got weapons.


Re: After i die i get weapons. - Markus1337 - 15.01.2015

And you have this code under OnPlayerSpawn?

if so, when do you assign them to teams?


Re: After i die i get weapons. - Franklyns - 15.01.2015

Why you dont make Commands like /weap or else?


Re: After i die i get weapons. - Glossy42O - 15.01.2015

Nah, it's lsgw plus, there is always noobs that spawn kill.

Anyways, yes it's under on player spawn


Re: After i die i get weapons. - Markus1337 - 15.01.2015

Quote:
Originally Posted by Franklyns
Посмотреть сообщение
Why you dont make Commands like /weap or else?
Why would he? It's much more comfortable for players to spawn with weapons rather than having them select new guns over and over again everytime they connect to the server.


Quote:
Originally Posted by Stuun23
Посмотреть сообщение
Nah, it's lsgw plus, there is always noobs that spawn kill.

Anyways, yes it's under on player spawn
Strange, there shouldn't be any issues then, It's hard to tell by just looking at the code snippet you have posted.


Re: After i die i get weapons. - CalvinC - 15.01.2015

You gotta check the team under OnPlayerSpawn, as well as OnPlayerDeath if you want to give weapons in both occassions.
You should use a switch instead though, much more efficient than alot of "if"-statements.


Re: After i die i get weapons. - Glossy42O - 15.01.2015

what do you mean?


Re: After i die i get weapons. - CalvinC - 15.01.2015

If you want to give players weapons when spawning.
You haven't described your issue, so it's quite hard to help you.