SA-MP Forums Archive
setteam help - 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)
+--- Thread: setteam help (/showthread.php?tid=340563)



setteam help - CyberrCookie - 07.05.2012

hello, im making a zombie game mode and i need a easy setteam command like /sethuman and /setzombie
i got the sscanf and zcmd thingy's but i just dont know how to handle those. it needs to look something like this : ( i used the lines of a kick command lol just to try but when i try the command on somwan else it just sets my team again!.
pawn Код:
COMMAND:setzombie(playerid,params[])
{
    new id,reason[80];
    if(PlayerInfo[playerid][pAdminLevel] <1) return SendClientMessage(playerid,COLOR_RED,"You're not allowed     to use this");
    if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/setzombie [playerid] [reason]");
    SendClientMessage(id,COLOR_RED,"Your team has been set to Zombie by an Admin.");
    SetPlayerPos(playerid, -2089.0293, -2342.6353, 30.6250);
    SetPlayerSkin(playerid, 162);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid, 9, 1);
    return 1;
}



Re: setteam help - Andregood - 07.05.2012

You're using playerid, which is you but you want to make anyone to a zombie. Use id in order to do that.


Код:
 SetPlayerSkin(id, 162);
    ResetPlayerWeapons(id);
    GivePlayerWeapon(id, 9, 1);
etc..


Re: setteam help - Jonny5 - 07.05.2012

pawn Код:
#define TEAM_Z  1
#define TEAM_H  2

COMMAND:setzombie(playerid,params[])
{
    new id;
    if(PlayerInfo[playerid][pAdminLevel] <1) return SendClientMessage(playerid,COLOR_RED,"You're not allowed     to use this");
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"USAGE:/setzombie [playerid] [Team]");
    SetPlayerTeam(id,TEAM_Z);
    SendClientMessage(id,COLOR_RED,"Your team has been set to Zombie by an Admin.");
    SetPlayerPos(id, -2089.0293, -2342.6353, 30.6250);
    SetPlayerSkin(id, 162);
    ResetPlayerWeapons(id);
    GivePlayerWeapon(id, 9, 1);
    return 1;
}



Re: setteam help - CyberrCookie - 08.05.2012

Thanks guys! it works +REP