Apply for cop,army or fbi wont work
#1

This is my requestspawn:

Код:
public OnPlayerRequestSpawn(playerid)
{
  new playername[MAX_PLAYER_NAME];
	if(gTeam[playerid]==Team_Cops) // POLICE
	{
	  if(strcmp(playername,"LVC_Chrham2",false)==0)
	  {
	    SendClientMessage(playerid,COLOR_BLUE,"Welcome to you, Police Officer! You are now on duty and you must do your best to protect Chrham's City!");
	    return 1;
	  }
	  else
	  {
	  	SendClientMessage(playerid,COLOR_BLUE,"Only cops who have applied at the forums can spawn.");
	  	SendClientMessage(playerid,COLOR_BLUE,"http://chrhamrpg.one-forum.net/businesses-f6/");
	  	return 0;
		}
	}
	if(gTeam[playerid]==Team_FBI) // FBI
	{
	  if(strcmp(playername,"LVC_Chrham2",false)==0)
	  {
	    SendClientMessage(playerid,COLOR_BLUE,"Welcome to you, FBI Officer! You are now on duty and you must do your best to protect Chrham's City!");
	    return 1;
	  }
	  else
	  {
	  	SendClientMessage(playerid,COLOR_BLUE,"Only FBI Officers who have applied at the forums can spawn.");
	  	SendClientMessage(playerid,COLOR_BLUE,"http://chrhamrpg.one-forum.net/businesses-f6/");
	  	return 0;
		}
	}
	if(gTeam[playerid]==Team_Army) // ARMY
	{
	  if(strcmp(playername,"LVC_Chrham2",false)==0)
	  {
	    SendClientMessage(playerid,COLOR_BLUE,"Welcome to you guy in the army! You must do your best to protect Chrham's City!");
	    return 1;
	  }
	  else
	  {
	  	SendClientMessage(playerid,COLOR_BLUE,"Only armys who have applied at the forums can spawn.");
	  	SendClientMessage(playerid,COLOR_BLUE,"http://chrhamrpg.one-forum.net/businesses-f6/");
	  	return 0;
		}
	} else {
	return 1;
	}
}
Its supposed to lock the skin for evryone but LVC_Chrham2, but it dont work. Can you helep me?
Reply
#2

Get the player name, and then try, if I understnad what you're trying to do.
Reply
#3

Quote:
Originally Posted by Swift_
Get the player name, and then try, if I understnad what you're trying to do.
Huh? Anyways.. Anyone know how to fix it?
Reply
#4


You know only people with the name "LVC_Chrham2" can join those teams?
Reply
#5

Quote:
Originally Posted by Swift_

You know only people with the name "LVC_Chrham2" can join those teams?
yes
Reply
#6

Then as i said before, you have to get the players name aswell.
pawn Код:
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
Reply
#7

Quote:
Originally Posted by Swift_
Then as i said before, you have to get the players name aswell.
pawn Код:
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
Im not gonna GET the name, im gonna check if the name IS LVC_Chrham2
Reply
#8

Quote:
Originally Posted by Chrham_2
Quote:
Originally Posted by Swift_
Then as i said before, you have to get the players name aswell.
pawn Код:
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
Im not gonna GET the name, im gonna check if the name IS LVC_Chrham2
You should really still DO it.

EDIT: right now, the playername variable = 0; Using GetPlayerName you set the variable to the players current name.
Reply
#9

Quote:
Originally Posted by Swift_
Quote:
Originally Posted by Chrham_2
Quote:
Originally Posted by Swift_
Then as i said before, you have to get the players name aswell.
pawn Код:
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
Im not gonna GET the name, im gonna check if the name IS LVC_Chrham2
You should really still DO it.
Ugh... Well. Can you fix my script then.. I will learn from that to
Reply
#10

Add that line right after the
pawn Код:
new playername[MAX_PLAYER_NAME];
variable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)