udb_hash symbol already defined -
kyriakos587 - 26.06.2015
Hello,
i want to ask you that how can i fix it ?
Код:
52) : error 021: symbol already defined: "udb_hash"
and the line of code 52
Код:
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
Thank you if you hepled me
Re: udb_hash symbol already defined -
Shetch - 26.06.2015
You already have the function udb_hash defined somewhere in your code.
Re: udb_hash symbol already defined -
kyriakos587 - 26.06.2015
Thanks i have fixed it ?
and i wanted to know how to make a /admin command please help me
Re: udb_hash symbol already defined -
Youssef221 - 26.06.2015
@kyriakos587, what do you want to do from this command (/admin command)?
Re: udb_hash symbol already defined -
kyriakos587 - 26.06.2015
i want /admin command so players can see whether the admins are online or not
Re: udb_hash symbol already defined -
Youssef221 - 26.06.2015
I use this:
PHP код:
COMMAND:admin(playerid,params[])
{
new id[MAX_PLAYER_NAME], string[128];
SendClientMessage(playerid, 0xFFAE00FF, " ");
SendClientMessage(playerid, 0xFFAE00FF, "----' Online Admins '----");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
switch(PlayerInfo[i][pAdmin])
{
case 1: AdmRank = "Trial Moderator";
case 2: AdmRank = "Moderator";
case 3: AdmRank = "Master Moderator";
case 4: AdmRank = "Trial Administrator";
case 5: AdmRank = "Administrator";
case 6: AdmRank = "Master Administrator";
case 7: AdmRank = "Trusted Administrator";
case 8: AdmRank = "Head Administrator";
case 9: AdmRank = "Co-Owner";
case 10: AdmRank = "Owner";
}
GetPlayerName(i, id, sizeof(id));
format(string, sizeof(string), "%s (%d) ({FF0000}%s{00FF00})", id, i, AdmRank);
SendClientMessage(playerid, 0x00FF00FF, string);
}
else if(!IsPlayerConnected(i) && PlayerInfo[i][pAdmin] <= 0)
{
SendClientMessage(playerid, 0xFFAE00FF, "There Are No Admins Online");
}
}
}
return 1;
}
Re: udb_hash symbol already defined -
kyriakos587 - 26.06.2015
Thanks
Re: udb_hash symbol already defined -
kyriakos587 - 26.06.2015
It shows me this error
Код:
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5494) : error 017: undefined symbol "AdmRank"
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5494) : error 017: undefined symbol "Administrator"
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5494) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5495) : error 014: invalid statement; not in switch
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5495) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5495) : error 001: expected token: ";", but found ":"
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5495) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\SAMP\gamemodes\freeroam.pwn(5495) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
Re: udb_hash symbol already defined -
Youssef221 - 26.06.2015
Here:
PHP код:
COMMAND:admin(playerid,params[])
{
new id[MAX_PLAYER_NAME], string[128];
SendClientMessage(playerid, 0xFFAE00FF, " ");
SendClientMessage(playerid, 0xFFAE00FF, "----' Online Admins '----");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
GetPlayerName(i, id, sizeof(id));
format(string, sizeof(string), "%s (%d) ", id, i,);
SendClientMessage(playerid, 0x00FF00FF, string);
}
else if(!IsPlayerConnected(i) && PlayerInfo[i][pAdmin] <= 0)
{
SendClientMessage(playerid, 0xFFAE00FF, "There Are No Admins Online");
}
}
}
return 1;
}
Re: udb_hash symbol already defined -
kyriakos587 - 26.06.2015
i made my own command like this
Код:
CMD:akill(playerid,params[])
{
if(!IsPlayerAnAdmin(playerid,4))return SendClientMessage(playerid,0xFF0000FF,"You're not allowed to use this command!");
new pID, string[128],string3[128];
if(sscanf(params,"u",pID))return SendClientMessage(playerid,COLOR_GREEN,"/akill [id]]");
format(string,sizeof(string),"You adminkilled %s.",PlayerName(pID));
for(new i=0;i<GetMaxPlayers();i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAnAdmin(i,1))
{
format(string3,sizeof(string3),"A: %s used the AKILL command.",PlayerName(playerid));
SendClientMessage(i,COLOR_ORANGE,string3);
}
}
}
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
SendClientMessage(pID,COLOR_ORANGE,"* An admin killed you by a command.");
SetPlayerHealth(pID,0);
return 1;
}
and i use IsPlayerAnAdmin Function