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

Description: Готовые команды
Moderator: SJplayer

May
Topic author, Ефрейтор
Ефрейтор
Avatar
May
Topic author, Ефрейтор
Ефрейтор
Posts: 22
Joined: 8 May 2013
With us: 11 years 4 months

#1by May » 12 May 2013, 14:43

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

В public OnPlayerCommandText(playerid, cmdtext[])

Code: Select all

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
    }   


Return to “Команды”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest