Help please :)
#1

Hey all .
Well, i have in my script these teams :

Код:
#define TEAM_Citizen 0

#define TEAM_Mayor 1

#define TEAM_Cop 2

#define TEAM_Hitman 3

#define TEAM_Mechanic 4

#define TEAM_Medic 5

#define TEAM_SG 6

#define TEAM_rober 7
Class :

Код:
	AddPlayerClass(240,-2062.5583,237.4662,35.7149,268.8936,22,272,25,40,4,1); //Citizen

	AddPlayerClass(228,-2653.6443,1388.2767,7.1301,212.8453,23,272,29,270,5,1); //mayor

	AddPlayerClass(265,-2642.2583,-274.9985,7.5393,135.0036,25,40,32,250,9,1); //cop

	AddPlayerClass(125,-2157.2119,649.5484,52.3672,267.0820,24,70,31,250,4,1); //hitman

	AddPlayerClass(50,-1377.4271,466.0897,7.1875,1.0348,22,272,30,300,9,1); //mechanic

	AddPlayerClass(276,-1754.9976,958.5851,24.8828,163.2550,25,40,24,70,4,1); //medic

	AddPlayerClass(164,-2665.4282,635.6348,14.4531,179.8403,33,40,23,272,4,1); //sg

  AddPlayerClass(293,-1635.0077,665.8105,7.1875,264.2244,29,300,22,170,3,1); //rober
The problem :
For example, the cop job is job id 1

Код:
if(GetPlayerJobId(playerid) == 1
I want to make for example if the player got the police job ( id 1 ) he can choose the section of cops, else he can't choose it, and the same thing for the others class / jobs.

Thanks for reading
Reply
#2

Anyone Please ?

Sorry for the bump
Reply
#3

pawn Код:
public OnPlayerRequestSpawn(playerid){
  if(GetPlayerJobID(playerid) == TEAM_COP && GetPlayerSkin(playerid) != copskkn1//use 'or',bla... ){
    send("You must choose cop skin");
  return false;
  }
  return true;
}
Reply
#4

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == TEAM_COP)
{
if(GetPlayerJobID(playerid) == TEAM_COP)
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"[ ! ] Welcome to officer: %s",name);
SendClientMessageToAll(TEAM_COP_COLOR,string);
return 1;
}
else SendClientMessage(playerid,COLOR_RED,"[ ! ] You are not a cop !");
return 0;
}
UNTESTED !!
Reply
#5

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
new tmp[50];
if(gTeam[playerid]==TEAM_COP)
{
    if(GetPlayerJobID(playerid) == TEAM_COP)
    {
    format(tmp,sizeof(tmp),"[ ! ] Welcome to Police Officer: %s",Name(playerid));
    SendClientMessageToAll(TEAM_POLICE_COLOR,tmp);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,c_r,"You are not a cop!");
    }
return 0;
}
    return 1;
}
TESTED !!
Reply
#6

Thanks a lot Coole For your help
It's Working

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)