SA-MP Forums Archive
Help 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: Help command (/showthread.php?tid=199583)



Help command - Amine_Mejrhirrou - 15.12.2010

Help command


problem : hi all ; i want some help with that : i want to create a comand to change a player's team something like
/HUMAN(id)(reason ) or /Zombie(id)(reason )can someone can show me how can i o that
my GM has 5 team ...
thanks for helping me


Re: Help command - <Weponz> - 16.12.2010

Use this Function..

Код:
ForceClassSelection(playerid);
??


Re : Help command - Amine_Mejrhirrou - 16.12.2010

ForceClassSelection(playerid); is likй F4 it gust forcй thй playйr to choos antoйhr skin. i looking for who can i forcй a plyйr to changй thй tйam
Quote:

if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);

if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR," Usage:/team (id)");
return 1;
}

new id = strval(tmp);
gMessage = strrest(cmdtext,idx);

if(!strlen(gMessage)) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR," Usage: /team (id)");
return 1;
}

if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/team : Bad player ID");
}

if(playerid != id) {
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
SetPlayerHealth(id,0);
SetPlayerTeam(id, 2);

}
return 1;
}




Re: Help command - Face9000 - 16.12.2010

Post your change team function.


Re : Help command - Amine_Mejrhirrou - 16.12.2010

ok this is tйam
Quote:

if(team[playerid] == 2)
{
SetPlayerTeam(playerid, 2);
SetPlayerArmour(playerid, 0);
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid,ZRED);
GameTextForPlayer(playerid,"~r~Zombie ~b~ KEY_FIRE to bit human",10000,3);
SetPlayerHealth(playerid, 200);
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
GivePlayerWeapon(playerid,1,0);
}




Re: Help command - HyperZ - 16.12.2010

Use
pawn Код:
ForceClassSelection(playerid);
Actually, This is simple way to change the Team.
pawn Код:
if(strcmp(cmdtext, "/class",true)==0)
    {
    ForceClassSelection(playerid);
    SendClientMessage(playerid, 0x0000FFAA,"[CLASS]> You have been forced to the class selection");
    SetPlayerHealth(playerid, 0.00);
    return 1;
    }



Re : Help command - Amine_Mejrhirrou - 16.12.2010

man ... if i use /class it will Chang MY class selection ... I'm looking for how can i change a target team
but thanks for trying to help me


Re : Help command - Amine_Mejrhirrou - 07.01.2011

what ever i have found a solution
thanks anyway