25.09.2009, 03:01
Ok I am having a problem saving teams. I am using the Nazi Zombie TDM's Register script.
I try to get it to save the teams but it won't work when you login you can't choose your faction.
I have tried pTeam, pTeamid, pteam, pteamid.
SCript for /team follows below.
I appreciate any help guys. Thanks in advance.
I try to get it to save the teams but it won't work when you login you can't choose your faction.
I have tried pTeam, pTeamid, pteam, pteamid.
SCript for /team follows below.
I appreciate any help guys. Thanks in advance.
Код:
if(strcmp(cmd, "/team", true) == 0) { if(IsPlayerConnected(playerid)) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /team [playerid] [teamid]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) if (PlayerInfo[playerid][pAdmin] > 4) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /team [playerid] [teamid]"); return 1; } teamid = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if (teamid > 0 && teamid < 10) { SetPlayerTeam(playerid,teamid); team[giveplayerid] = teamid; SetPlayerHealth(giveplayerid, 0); SetPlayerMoney(GetPlayerMoney(giveplayerid)+100); SendClientMessage(giveplayerid, COLOR_WHITE,"An Admin has changed your team."); } else { SendClientMessage(playerid, COLOR_YELLOW, "Invalid teamid(1-9)."); } } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } } else SendClientMessage(playerid, COLOR_YELLOW, "You are not an Admin."); return 1; }