Рекомендованные сообщения



4 posts in this topic

Баг заключается в следующем:

Выдаем 1 лвл выдается 31, выдаем 2 выдается 32.

CMD:setadmin(playerid, params[])
{
	new query[70];
    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;
   	new nameplayer[MAX_PLAYER_NAME];
	if(sscanf(params,"us[24]",params[0],nameplayer)) return SendClientMessage(playerid,COLOR_WARNING,"Используйте: /setadmin [ид] [уровень]");
	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` = '%d' WHERE `name` = '%s'",PLAYER_DATA[params[0]][data_ADMLVL] = params[1]);
    mysql_function_query(dbHandle, query, false, "", "");
    new str[145];
    format(str,sizeof(str),"[A] %s поставил на админку %s",PLAYER_DATA[playerid][data_NAME]);
	SendAdminMessage(0x666699FF,str);
	return true;
}

 

Share this post


Link to post
Share on other sites
Спойлер

CMD:setadmin(playerid, params[])
{
	new query[70];
    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;
   	new nameplayer[MAX_PLAYER_NAME];
	if(sscanf(params,"ud",params[0],params[1])) return SendClientMessage(playerid,COLOR_WARNING,"Используйте: /setadmin [ник] [уровень]");
	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` = '%d' WHERE `name` = '%s'",PLAYER_DATA[params[0]][data_ADMLVL] = params[1], PLAYER_DATA[params[0]][data_NAME]);
    mysql_function_query(dbHandle, query, false, "", "");
    new str[145];
    format(str,sizeof(str),"[A] %s поставил на админку %s",PLAYER_DATA[playerid][data_NAME], PLAYER_DATA[params[0]][data_NAME]);
	SendAdminMessage(0x666699FF,str);
	return true;
}

 

 

Share this post


Link to post
Share on other sites

@DEST

C:\Users\Александр\Desktop\VirtualTech RP\gamemodes\new.pwn(19003) : warning 204: symbol is assigned a value that is never used: "nameplayer"

 

Share this post


Link to post
Share on other sites

@Remmi_Feed удалите из этой команды строку new nameplayer[MAX_PLAYER_NAME]; 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0