[ASK] teamid limit on SetPlayerTeam ? - 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: [ASK] teamid limit on SetPlayerTeam ? (
/showthread.php?tid=273549)
[ASK] teamid limit on SetPlayerTeam ? -
hack4ever - 02.08.2011
I have a question for my problem. I want set my teamid to 300, but the output is not 300, but 44. I have use SetTeamCount at OnGameModeInit, but it still doesn't work. It means teamid is limited ?
Here's the pic
Here's my code
pawn Код:
CMD:setteam(playerid, params[])
{
new team,string[64];
if(sscanf(params,"d",team)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE : /setteam [teamid]");
if(team < 20 || team > 999999999) return SendClientMessage(playerid, COLOR_RED, "Range teamid is between 20 and 999,999,999");
SetPlayerTeam(playerid,team);
PlayerData[playerid][PlayerTeam] = team;
format(string,sizeof(string),"Your team has been changed. Your team -> %d.",GetPlayerTeam(playerid));
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
Here's the chatlog
Код:
[14:56:48] Your team has been changed. Your team -> 44.
Thanks
Re: [ASK] teamid limit on SetPlayerTeam ? -
Kush - 02.08.2011
Quote:
Originally Posted by hack4ever
I have a question for my problem. I want set my teamid to 300, but the output is not 300, but 44. I have use SetTeamCount at OnGameModeInit, but it still doesn't work. It means teamid is limited ?
Here's the pic
Here's my code
pawn Код:
CMD:setteam(playerid, params[]) { new team,string[64]; if(sscanf(params,"d",team)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE : /setteam [teamid]"); if(team < 20 || team > 999999999) return SendClientMessage(playerid, COLOR_RED, "Range teamid is between 20 and 255"); SetPlayerTeam(playerid,team); PlayerData[playerid][PlayerTeam] = team; format(string,sizeof(string),"Your team has been changed. Your team -> %d.",GetPlayerTeam(playerid)); SendClientMessage(playerid, COLOR_GREEN, string); return 1; }
Here's the chatlog
Код:
[14:56:48] Your team has been changed. Your team -> 44.
Thanks
|
You do understand that those are simply values. They have nothing to do with setting a players team. Each team has it's own assigned value. If you have to teams, USA and Russia as an example, USA would probably be 1 and Russia 2.
According to your code, you have 9999999 teams? But then you have a return message saying the maximum is 255.
Re: [ASK] teamid limit on SetPlayerTeam ? -
hack4ever - 02.08.2011
Quote:
Originally Posted by Kush
You do understand that those are simply values. They have nothing to do with setting a players team. Each team has it's own assigned value. If you have to teams, USA and Russia as an example, USA would probably be 1 and Russia 2.
According to your code, you have 9999999 teams? But then you have a return message saying the maximum is 255.
|
Yes, because i forgot to rewrite the code, and just rewrite the limitation team for my code.
Re: [ASK] teamid limit on SetPlayerTeam ? -
cessil - 02.08.2011
you probably have SetTeamCount to something lower than 300
Re: [ASK] teamid limit on SetPlayerTeam ? -
hack4ever - 02.08.2011
Quote:
Originally Posted by Kush
You do understand that those are simply values. They have nothing to do with setting a players team. Each team has it's own assigned value. If you have to teams, USA and Russia as an example, USA would probably be 1 and Russia 2.
According to your code, you have 9999999 teams? But then you have a return message saying the maximum is 255.
|
Quote:
Originally Posted by cessil
you probably have SetTeamCount to something lower than 300
|
It means teamid has limitation until 255 ?
Re: [ASK] teamid limit on SetPlayerTeam ? -
Vince - 02.08.2011
I think it wraps around indeed. There are a maximum of 256 team (0-255), NO_TEAM is also defined as 255, and 300-256 happens to be 44.