/kick(С диалогом)

Готовые команды

Модератор: SJplayer

Аватара
Автор темы
May
Ефрейтор
Ефрейтор
Сообщения: 22
Зарегистрирован: 8 мая 2013
Репутация: 2
С нами: 5 лет 9 месяцев

/kick(С диалогом)

Сообщение #1 May » 12 мая 2013, 14:43

Здравствуйте ув.пользователи павно-инфо.ру,вот решил выложить /kick с диалогом

В public OnPlayerCommandText(playerid, cmdtext[])

Код: Выделить всё

if(strcmp(cmd"/kick"true) == 0
    { 
            if(
IsPlayerConnected(playerid)) 
            { 
                    
tmp strtok(cmdtextidx); 
                    if(!
strlen(tmp)) 
                    { 
                            
SendClientMessage(playeridCOLOR_CMD"[INFO] {FFFFFF} /kick [playerid/PartOfName] [reason]"); 
                            return 
1
                    } 
                    
giveplayerid ReturnUser(tmp); 
                    if (
PlayerInfo[playerid][pAdmin] >= 1
                    { 
                            if(
IsPlayerConnected(giveplayerid)) 
                            { 
                                    if(
giveplayerid != INVALID_PLAYER_ID
                                    { 
                                            
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer)); 
                                            
GetPlayerName(playeridsendernamesizeof(sendername)); 
                                            new 
length strlen(cmdtext); 
                                            while ((
idx length) && (cmdtext[idx] <= ' ')) 
                                            { 
                                                    
idx++; 
                                            } 
                                            new 
offset idx
                                            new 
result[64]; 
                                            while ((
idx length) && ((idx offset) < (sizeof(result) - 1))) 
                                            { 
                                                    
result[idx offset] = cmdtext[idx]; 
                                                    
idx++; 
                                            } 
                                            
result[idx offset] = EOS
                                            if(!
strlen(result)) 
                                            { 
                                                    
SendClientMessage(playeridCOLOR_CMD"[INFO] {FFFFFF} /kick [playerid/PartOfName] [reason]"); 
                                                    return 
1
                                            } 
                                            
format(stringsizeof(string), "{4f7942}Название Сервера{FFFFFF}: %s кикнут администратором %s, причина: %s"giveplayersendername, (result)); 
                                            if(
PlayerInfo[giveplayerid][pSex] == 1
                                            { 
                                                    
format(stringsizeof(string), "{4f7942}Название Сервера{FFFFFF}: %s кикнут администратором %s, причина: %s"giveplayersendername, (result)); 
                                            } 
                                            else if(
PlayerInfo[giveplayerid][pSex] == 2
                                            { 
                                                    
format(stringsizeof(string), "{4f7942}Название Сервера{FFFFFF}: %s кикнута администратором %s, причина: %s"giveplayersendername, (result)); 
                                            } 
                                            
SendClientMessageToAll(COLOR_LIGHTREDstring); 
////////////////////////////////////dialog///////////// 
                                            
new yearmonth,day
                                            
getdate(yearmonthday); 
                                            new 
coordsstring3[512]; 
                                            new 
msg3[] = "{FF0000}__________________________________\n\n\t{FF0000}Имя: {FFFFFF}%s\n\t{FF0000}Кикнул(а): {FFFFFF}%s\n\t{FF0000}Дата кика: {FFFFFF}(%d.%d.%d)\n\t{FF0000}Причина: {FFFFFF}%s\n\t{FF0000}Чтобы выйти введите: {FFFFFF}/q\n\t{FF0000}Форум: {FFFFFF}Название Сайта\n\n{FF0000}__________________________________"
                                            
format(coordsstring3sizeof coordsstring3msg3giveplayer,sendername,day,month,year,result); 
                                            
ShowPlayerDialog(giveplayerid,82,DIALOG_STYLE_MSGBOX,"- Вы кикнуты -",coordsstring3,"Выход",""); 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
                                            
Kick(giveplayerid); 
                                            return 
1
                                    } 
                            } 
                    } 
                    else 
                    { 
                            
format(stringsizeof(string), "Недостаточно прав для использования команды."giveplayerid); 
                            
SendClientMessage(playeridCOLOR_GRAD1string); 
                    } 
            } 
            return 
1
    }   

! ! !


  • Похожие темы
    Статистика
    Последнее сообщение

Вернуться в «Команды»

Кто сейчас на форуме