17.12.2013, 23:49
PHP код:
new id = GetPlayerID(InfoOrg[org][Lider]);
Код HTML:
C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(459) : error 017: undefined symbol "GetPlayerID"
new id = GetPlayerID(InfoOrg[org][Lider]);
C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(459) : error 017: undefined symbol "GetPlayerID"
stock GetPlayerID(const playername[], partofname=0) //By Jan "DracoBlue" Schьtze (edited by Gabriel "Larcius" Cordes)
{
new i;
new playername1[MAX_STRING];
for (i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i,playername1,sizeof(playername1));
if (strcmp(playername1,playername,true)==0)
{
return i;
}
}
}
new correctsigns_userid=-1;
new tmpuname[MAX_STRING];
new hasmultiple=-1;
if(partofname)
{
for (i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
GetPlayerName(i,tmpuname,sizeof(tmpuname));
if (strfind(tmpuname,partofname,true)==0)
{
hasmultiple++;
correctsigns_userid=i;
}
if (hasmultiple>0)
{
return -2;
}
}
}
}
return correctsigns_userid;
}
C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(459) : warning 204: symbol is assigned a value that is never used: "id" C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(823) : error 017: undefined symbol "MAX_STRING" C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(823) : error 009: invalid array size (negative, zero or out of bounds) C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(823) : error 036: empty statement C:\Users\LucaS\Desktop\GM TDM\gamemodes\Untitled.pwn(823) : fatal error 107: too many error messages on one line |
stock GetPlayerID(const parte_nome[]) {
for(new i; i <= GetMaxPlayers(); i++) {
if(!IsPlayerConnected(i)) continue;
new ni[MAX_PLAYER_NAME];
GetPlayerName(i, ni, sizeof(ni));
if(strfind(ni, parte_nome, false) > -1)
return i;
}
return INVALID_PLAYER_ID;
}