- เครดิต
- 6782
- ความรู้
-
- เงิน $
-
- ความดี
-
|
//[ออกแก๊ง/รัฐ]///
forward IsAGangMember2(playerid);
forward IsAService(playerid);
forward IsACop2(playerid);
//------------///
public IsAService(playerid)
{
if(IsPlayerConnected(playerid))
{
new member = PlayerInfo[playerid][pMember];
if(member==9 || member==10 || member==11)
{
return 1;
}
}
return 0;
}
public IsACop2(playerid)
{
if(IsPlayerConnected(playerid))
{
new member = PlayerInfo[playerid][pMember];
if(member==1 || member==2 || member==3 || member==4 || member==7 || member==19 || member==27 || member==28|| member==29)
{
return 1;
}
}
return 0;
}
public IsAGangMember2(playerid)
{
if(IsPlayerConnected(playerid))
{
new member = PlayerInfo[playerid][pMember];
if(member==5 || member==6 || member==8 || member==12 || member==13 || member==14|| member==15 || member==16 || member==17 || member==18 || member==20 || member==21 || member==22 || member==23 || member==24 || member==25 || member==26 || member==28)
{
return 1;
}
}
return 0;
} //----------------------------------[Quitgang & faction]--------------------------------------
if(strcmp(cmd, "/quitgang", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (IsAGangMember2(playerid) || IsAService(playerid))
{
format(string, sizeof(string), "* คุณได้ออกจากแก๊งแล้ว !");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* คุณกลายเป็นคนธรรมดาอีกครั้ง !");
gTeam[playerid] = 3;
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pChar] = 0;
new rand = random(sizeof(CIV));
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
MedicBill[playerid] = 0;
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "คุณไม่สามารถออกแก๊งได้เพราะคุณไม่มีแก๊ง !");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/quitfaction", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (IsACop2(playerid))
{
format(string, sizeof(string), "* คุณได้ออกจากเจ้าหน้าที่แล้ว !");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* คุณกลับเป็นคนธรรมดาอีกครั้ง !");
gTeam[playerid] = 3;
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pChar] = 0;
new rand = random(sizeof(CIV));
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
MedicBill[playerid] = 0;
SpawnPlayer(playerid);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "คุณไม่สามารถออกได้เพราะคุณไม่ใช่เจ้าหน้าที่ !");
return 1;
}
}
return 1;
} Credit : Streetback
|
|