setteam help
#1

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;
}
Reply
#2

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..
Reply
#3

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;
}
Reply
#4

Thanks guys! it works +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)