SA-MP Forums Archive
New problem. - 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: New problem. (/showthread.php?tid=98992)



New problem. - kujox4 - 24.09.2009

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?