[ASK] teamid limit on SetPlayerTeam ?
#1

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

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

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

you probably have SetTeamCount to something lower than 300
Reply
#5

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 ?
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)