New problem.
#1

Ok I make a piece in the registration and login system for teams but it won't save that team. Script pieces follows bellow.


Код:
	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;
	}

I was trying to make it in the registration system as pTeam, pTeamid, It still won't save your team and allow you to login on that team's faction. Any ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)