/quitfaction command - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /quitfaction command (
/showthread.php?tid=76897)
/quitfaction command -
pierhs - 07.05.2009
I made a /quitfaction command but when players use it they have the same skin and team
even though i have set the [pSkin] and [pTeam]
Re: /quitfaction command -
killerx100 - 07.05.2009
Try this one..
pawn Код:
if(strcmp(cmd, "/quitfaction", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, " /quitfaction ");
return 1;
}
if(PlayerInfo[playerid][pMember] >= 1)
{
format(string, sizeof(string), "You have left your faction.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
gTeam[playerid] = 3;
SetPlayerHealth(playerid, 0);
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pLeader] = 0;
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);
}
}//not connected
}
return 1;
}
Re: /quitfaction command -
Alion133 - 09.05.2009
I start to compile and jumps out an empty window why it occurs?!
Re: /quitfaction command -
Dark_Kostas - 09.05.2009
Im using that one, and its working perfect.
pawn Код:
if(strcmp(cmd, "/quitteam", true) == 0)
{
if(PlayerInfo[playerid][pMember] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are Civilian. Can't do that !");
return 1;
}
if(PlayerInfo[playerid][pLeader] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Ask an admin to remove your leader !");
return 1;
}
SendClientMessage(playerid, COLOR_BLUE, "You are now a Civilian again !");
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pChar] = 0;
SetPlayerToTeamColor(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
return 1;
}
Re: /quitfaction command -
arachimi - 09.05.2009
If not try this
Код:
if(strcmp(cmd, "/quitteam", true) == 0)
{
if(PlayerInfo[playerid][pMember] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You are Civilian. Can't do that !");
return 1;
}
if(PlayerInfo[playerid][pLeader] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Ask an admin to remove your leader !");
return 1;
}
{
SendClientMessage(playerid, COLOR_YELLOW, "You are now a Civilian again !");
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pChar] = 0;
SetPlayerToTeamColor(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
return 1;
}
}
Re: /quitfaction command -
ralf12 - 03.08.2009
hey i wanna know how i add it to my script??
Re: /quitfaction command -
pierhs - 04.08.2009
Copy it and paste it under 'public OnPlayerCommandText' or under another command e.g /quitjob