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



Не найдено.

4 posts in this topic

Почему-то не могу не повысить и не понизить. 

Спойлер

CMD:rang(playerid,params[])
{
    if(GetPVarInt(playerid, "logged") == 0) return 1;
    
    if(player_info[playerid] == TEAM_NONE)
        return Send(playerid, COLOR_RED, "Âû íå ñîñòîèòå â îðãàíèçàöèè");

    if(player_info[playerid][RANK] < 9)
        return Send(playerid, COLOR_RED, "Âàì íåäîñòóïíà äàííàÿ âîçìîæíîñòü");
        
    extract params -> new to_player, string: rang[2]; else return Send(playerid, 0xFFCC00AA, "•[Ïîäñêàçêà] {ffffff}Ââåäèòå: /rang [ID èãðîêà] [+/-]");
        
    if(playerid == to_player)
        return Send(playerid, COLOR_RED, "Âû óêàçàëè ñâîé èä");
        
     if(player_info[playerid] != player_info[to_player])
       return Send(playerid, COLOR_RED, "Èãðîê íå ÿâëÿåòñÿ ÷ëåíîì Âàøåé îðãàíèçàöèè!");
       
    if(strlen(rang) >= 1)
        return Send(playerid, 0xFFCC00AA, "•[Ïîäñêàçêà] {ffffff}Ââåäèòå: /rang [ID èãðîêà] [+/-]");
    
    switch(rang[0])
    {
        case '+':
        {
            if(player_info[to_player][RANK] == 9 || player_info[to_player][LEADER] != 0)
                return Send(playerid, COLOR_RED, "Íå ìåíüøå 1 è íå áîëüøå 9!");

            player_info[to_player][RANK] += 1;
            
            static const fmt_msg[] = "Âû ïîâûñèëè %s[%d] äî %s (%d)";
            new string[sizeof(fmt_msg)+(-2+3)+(-2+20)];
            format(string, sizeof(string), fmt_msg, player_info[to_player][NAME], to_player, ranknames[ player_info[to_player] ][ player_info[to_player][RANK] ], player_info[to_player][RANK]);
            Send(playerid, COLOR_BLUE, string);
            
            static const fmt_msg1[] = "Âàø ðàíã â îðãàíèçàöèè áûë ïîâûøåí äî %d (%s)";
            new string1[sizeof(fmt_msg1)+(-2+3)+(-2+20)];
            format(string1, sizeof(string1), fmt_msg1, player_info[to_player][RANK], ranknames[ player_info[to_player] ][ player_info[to_player][RANK] ]);
            Send(to_player, COLOR_BLUE, string1);

            static const fmt_query[] = "UPDATE `accounts` SET `rank` = '%d' WHERE `id` = '%d' LIMIT 1";
            new query[sizeof(fmt_query)+(-2+1)+(-2+9)];
            format(query, sizeof(query), fmt_query, player_info[to_player][RANK], player_info[to_player][ID]);
            mysql_query(dbHandle, query);
        }
        case '-':
        {
            if(player_info[playerid][RANK] == 9)
            {
                if(player_info[to_player][LEADER] != 0)
                {
                    return Send(playerid, COLOR_RED, "Âû íå ìîæåòå ïîíèçèòü ëèäåðà!");
                }
            }
               
            if(player_info[to_player][RANK] == 1)
                return Send(playerid, 0xFFCC00AA, "•[Ïîäñêàçêà] {ffffff}Ââåäèòå: /uninvite [èä èãðîêà] [ïðè÷èíà]");
                
            player_info[to_player][RANK] -= 1;
                
            static const fmt_msg[] = "Âû ïîíèçèëè %s[%d] äî %s (%d)";
            new string[sizeof(fmt_msg)+(-2+3)+(-2+20)];
            format(string, sizeof(string), fmt_msg, player_info[to_player][NAME], to_player, ranknames[ player_info[to_player] ][ player_info[to_player][RANK] ], player_info[to_player][RANK]);
            Send(playerid, COLOR_BLUE, string);

            static const fmt_msg1[] = "Âàø ðàíã â îðãàíèçàöèè áûë ïîíèæåí äî %d (%s)";
            new string1[sizeof(fmt_msg1)+(-2+3)+(-2+20)];
            format(string1, sizeof(string1), fmt_msg1, player_info[to_player][RANK], ranknames[ player_info[to_player] ][ player_info[to_player][RANK] ]);
            Send(to_player, COLOR_BLUE, string1);

            static const fmt_query[] = "UPDATE `accounts` SET `rank` = '%d' WHERE `id` = '%d' LIMIT 1";
            new query[sizeof(fmt_query)+(-2+1)+(-2+9)];
            format(query, sizeof(query), fmt_query,player_info[to_player][RANK], player_info[to_player][ID]);
            mysql_query(dbHandle, query);
        }
    }
    
    return 1;
}

 

 

Edited by odosenok
Причина: перезалил код.

Заметка от odosenok , создано

Как залить код в теги "Код" и "спойлер"?

Share this post


Link to post
Share on other sites

@Gaiduk, в чат вообще что-нибудь пишет?

Share this post


Link to post
Share on other sites

@odosenok , пишет  Подсказка Введите: /rang [ID игрока] [+/-]

Share this post


Link to post
Share on other sites

Пожалуйста скопируйте код на "русской раскладки клавиатуры" и после, скиньте его повторно . 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Radmiz
      By Radmiz
          if(pickupid == sadpick){         if(GetPVarInt(playerid,"Sadov") == 0) {             SetPVarInt(playerid,"Sadov", 1);             SetPlayerSkin(playerid, 73);             SetPlayerCheckpoint(playerid,2157.0464,-1707.6362,15.0859,3.0);               SendClientMessage(playerid,0x00ff39,"Âû óñòðîèëèñü íà ðàáîòó ñàäîâíèêà");               SendClientMessage(playerid,0xfeff00,"Çà 1 ïîñàæàíûé êóñò âàì áóäóò ïëàòèòü ïî 345$");         }         else {             PI[playerid][pCash] += GetPVarInt(playerid,"SadovM")*345;             SetPlayerSkin(playerid,PI[playerid][pSkin]);             ClearAnimations(playerid);             DeletePVar(playerid,"Sadov");             DeletePVar(playerid,"SadovM");             DeletePVar(playerid,"SadovW");             SendClientMessage(playerid,0xff0000,"Âû óâîëèëèñü ñ ðàáîòû ñàäîâíèêà");             DisablePlayerCheckpoint(playerid);  
      я хз что за иероглифы