What is wrong here in this code -
boyan96 - 26.09.2011
PHP код:
if (strcmp(cmdtext, "/events", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "Events admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pEventadmin] >= 1
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
Message(playerid, COLOR_GREEN, string);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "*** Server Info *** : No events admins ONLINE");
}
}
}
}
SendClientMessage(playerid, COLOR_GREEN, "______________");
}
return 1;
}
Re: What is wrong here in this code -
Xyrex - 26.09.2011
pawn Код:
if (strcmp(cmdtext, "/events", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new count=0;
SendClientMessage(playerid, COLOR_GREEN, "Events admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pEventadmin] >= 1)
{
count++;
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
Message(playerid, COLOR_GREEN, string);
}
}
}
if(count==0)
return SendClientMessage(playerid, COLOR_YELLOW, "*** Server Info *** : No events admins ONLINE");
SendClientMessage(playerid, COLOR_GREEN, "______________");
}
return 1;
}
Re: What is wrong here in this code -
boyan96 - 26.09.2011
its not only this because pawno is crash
Re: What is wrong here in this code -
Xyrex - 26.09.2011
Edited.
Re: What is wrong here in this code -
Rachael - 26.09.2011
If you can't see what is wrong, then I seriously doubt me debugging your script is going to help you
pawn Код:
if (strcmp(cmdtext, "/events", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "Events admins Online:");
new
count,
string[64]
;
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pEventadmin] >= 1
{
GetPlayerName(i, string, sizeof(string));
format( string , sizeof(string) , "(%d) %s" , i , string );
SendClientMessage(playerid, COLOR_GREEN, string);
count++;
}
}
}
if( !count )
{
SendClientMessage(playerid, COLOR_YELLOW, "*** Server Info *** : No events admins ONLINE");
} else {
SendClientMessage(playerid, COLOR_GREEN, "______________");
}
}
return 1;
}
basically, the logic, indentation, and number of braces in this piece of code is completely wrong.
good luck
Re: What is wrong here in this code -
Jafet_Macario - 26.09.2011
Quote:
Originally Posted by boyan96
its not only this because pawno is crash
|
https://sampforum.blast.hk/showthread.php?tid=171429
Re: What is wrong here in this code -
boyan96 - 26.09.2011
C:\Users\User\Desktop\ss.pwn(11619) : error 017: undefined symbol "Message"
11619>>>>> Message(playerid, COLOR_GREEN, string);
Re: What is wrong here in this code -
Jafet_Macario - 26.09.2011
pawn Код:
#define Message SendClientMessage
or
pawn Код:
SendClientMessage(playerid, COLOR_GREEN, string);
Re: What is wrong here in this code -
boyan96 - 26.09.2011
its works but didn't show online events admins