Show Players On A Team 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: Show Players On A Team problem? (
/showthread.php?tid=167348)
Show Players On A Team problem? -
lSCARl - 12.08.2010
okay i have this script that is suppose to show the players on a team... but! instead of showing the players on TEAM_HIDER 0... the command only works for TEAM_HIDER 0 showing the names of all players (i think of all players)
here is the code someone help me fix it please
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/alive", true)) {
for(new i = 0; i < GetMaxPlayers(); i ++ ) {
if(!IsPlayerConnected(i)) continue;
if(gTeam[playerid] == TEAM_HIDER) {
GetPlayerName(i, zzst, 24);
SendClientMessage(playerid, 0xFFFFFFA, zzst);
}
}
return 1;
}
return 0;
}
Re: Show Players On A Team problem? -
CyNiC - 12.08.2010
Your code is bad.
Try it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/alive", true)) {
for(new i = 0; i < GetMaxPlayers(); i ++ ) {
if(!IsPlayerConnected(i)) continue;
if(gTeam[i] == TEAM_HIDER) {
GetPlayerName(i, zzst, 24);
SendClientMessage(playerid, 0xFFFFFFA, zzst);
}
}
return 1;
}
return 0;
}
Re: Show Players On A Team problem? -
lSCARl - 12.08.2010
Quote:
Originally Posted by cynic
Your code is bad.
Try it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
if(!strcmp(cmdtext, "/alive", true)) { for(new i = 0; i < GetMaxPlayers(); i ++ ) { if(!IsPlayerConnected(i)) continue; if(gTeam[i] == TEAM_HIDER) { GetPlayerName(i, zzst, 24); SendClientMessage(playerid, 0xFFFFFFA, zzst); } } return 1; } return 0; }
|
will try
Re: Show Players On A Team problem? -
lSCARl - 12.08.2010
Quote:
Originally Posted by cynic
Your code is bad.
Try it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
if(!strcmp(cmdtext, "/alive", true)) { for(new i = 0; i < GetMaxPlayers(); i ++ ) { if(!IsPlayerConnected(i)) continue; if(gTeam[i] == TEAM_HIDER) { GetPlayerName(i, zzst, 24); SendClientMessage(playerid, 0xFFFFFFA, zzst); } } return 1; } return 0; }
|
WIN!!!!!!!!!
Re: Show Players On A Team problem? -
wups - 12.08.2010
It is still not right. If a player with ID 5 disconnect, ID 6,7,8 etc. will not count.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/alive", true)) {
for(new i = 0; i < GetMaxPlayers(); i ++ )
{
if(IsPlayerConnected(i))
{
if(gTeam[i] == TEAM_HIDER)
{
GetPlayerName(i, zzst, 24);
SendClientMessage(playerid, 0xFFFFFFA, zzst);
}
}
}
return 1;
}
return 0;
}
Re: Show Players On A Team problem? -
lSCARl - 12.08.2010
Quote:
Originally Posted by wups
It is still not right. If a player with ID 5 disconnect, ID 6,7,8 etc. will not count.
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/alive", true)) {
for(new i = 0; i < GetMaxPlayers(); i ++ )
{
if(!IsPlayerConnected(i))
{
if(gTeam[i] == TEAM_HIDER)
{
GetPlayerName(i, zzst, 24);
SendClientMessage(playerid, 0xFFFFFFA, zzst);
}
}
}
return 1;
}
return 0;
}
|
this just makes a big blank space in the chat.
Re: Show Players On A Team problem? -
wups - 13.08.2010
Fixed...