- 0
Sign in to follow this
Followers
0
Выдача администратора
Asked by
Remmi_Jefferson P
,
Question
Лучший ответ
запрос не правильно делаешь
mysql_format(dbHandle,query, sizeof(query),"UPDATE `accounts` SET `admlvl` = 'u'");
замени на
mysql_format(dbHandle,query, sizeof(query),"UPDATE `accounts` SET `admlvl` = '%d' WHERE `name` = '%s'",params[0],nameplayer);
и
if(sscanf(params,"ud[100]",params[0],params[1])) return SendClientMessage(playerid,COLOR_WARNING,"Используйте: /setadmin [ид] [уровень]");
замени на
new nameplayer[MAX_PLAYER_NAME];
if(sscanf(params,"us[24]",params[0],nameplayer)) return SendClientMessage(playerid,COLOR_WARNING,"Используйте: /setadmin [ид] [уровень]");
забыл ещё
if(!IsPlayerConnected(params[0]))return SendClientMessage(playerid,COLOR_WARNING,"Данного ID нет на сервере!"); на if(!IsPlayerConnected(GetPlayerID(nameplayer)))return SendClientMessage(playerid,COLOR_WARNING,"Данного ID нет на сервере!"); и в самый низ мода (Если GetPlayerID нету) stock GetPlayerID(string[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { new testname[MAX_PLAYER_NAME]; GetPlayerName(i, testname, sizeof(testname)); if(strcmp(testname, string, true, strlen(string)) == 0) { return i; } } } return INVALID_PLAYER_ID; }
if(!IsPlayerConnected(params[0]))return SendClientMessage(playerid,COLOR_WARNING,"Данного ID нет на сервере!"); на if(!IsPlayerConnected(GetPlayerID(nameplayer)))return SendClientMessage(playerid,COLOR_WARNING,"Данного ID нет на сервере!"); и в самый низ мода (Если GetPlayerID нету) stock GetPlayerID(string[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { new testname[MAX_PLAYER_NAME]; GetPlayerName(i, testname, sizeof(testname)); if(strcmp(testname, string, true, strlen(string)) == 0) { return i; } } } return INVALID_PLAYER_ID; }
This topic is now closed to further replies.
Sign in to follow this
Followers
0
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By Nik_Rofid
if(IsPlayerInRangeOfPoint(playerid, 5.0, -433.155, 782.72, 12.5547)) Dialog(playerid, DIALOG_WSP_ELOMS, DIALOG_STYLE_MSGBOX, "{ffffff}Разработчик","{ffffff}Взломаем сервер?","Да", "Нет");
}
else //Еррор здесь
{
SCM(playerid, 0xCECECEFF, "2331");
}
Проблема: Здравсвуйте, При компиляции вылезла 1 ошибка C:\Users\User\Desktop\Мод 7.1 с гс чат\gamemodes\new.pwn(20655) : error 010: invalid function or declaration
Буду рад если поможете!
-
Posted · Report post
Проблема заключается в следующем. Начал делать команду, доделал и тут:
CMD:setadmin(playerid, params[]) { if(antiflood[playerid] > 0) return SendClientMessage(playerid, COLOR_WARNING,"Не флуди!"); antiflood[playerid]++; if(PLAYER_DATA[playerid][data_LOGGED] == false) return SendClientMessage(playerid,COLOR_WARNING,"Вы не авторизованы на сервере!"); if(PLAYER_DATA[playerid][data_ADMLVL] < 7) return true; if(sscanf(params,"ud[100]",params[0],params[1])) return SendClientMessage(playerid,COLOR_WARNING,"Используйте: /setadmin [ид] [уровень]"); if(!IsPlayerConnected(params[0]))return SendClientMessage(playerid,COLOR_WARNING,"Данного ID нет на сервере!"); if(PLAYER_DATA[params[0]][data_LOGGED] == false)return SendClientMessage(playerid,COLOR_WARNING,"Данный игрок не прошел авторизацию!"); if(PLAYER_DATA[params[0]][data_ADMLVL] > PLAYER_DATA[playerid][data_ADMLVL]) return SendClientMessage(playerid, COLOR_WARNING, "Нельзя применить к старшей администрации!"); mysql_format(dbHandle,query, sizeof(query),"UPDATE `accounts` SET `admlvl` = 'u' WHERE `name` = '%e'", name); mysql_function_query(dbHandle, query, false, "", ""); new str[145]; format(str,sizeof(str),"[A] %s поставил на админку %s",PLAYER_DATA[playerid][data_NAME],name); SendAdminMessage(0x666699FF,str); }
Ругается на строку:
mysql_format(dbHandle,query, sizeof(query),"UPDATE `accounts` SET `admlvl` = 'u' WHERE `name` = '%e'", name);
Ошибки:
C:\Users\Александр\Desktop\VirtualTech RP\gamemodes\new.pwn(19006) : error 017: undefined symbol "query" C:\Users\Александр\Desktop\VirtualTech RP\gamemodes\new.pwn(19006) : error 017: undefined symbol "query" C:\Users\Александр\Desktop\VirtualTech RP\gamemodes\new.pwn(19006) : error 029: invalid expression, assumed zero C:\Users\Александр\Desktop\VirtualTech RP\gamemodes\new.pwn(19006) : fatal error 107: too many error messages on one line
Share this post
Link to post