After i die i get weapons.
#1

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;
  } 
Reply
#2

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

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

And you have this code under OnPlayerSpawn?

if so, when do you assign them to teams?
Reply
#5

Why you dont make Commands like /weap or else?
Reply
#6

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

Anyways, yes it's under on player spawn
Reply
#7

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.
Reply
#8

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.
Reply
#9

what do you mean?
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)