kick error
#1

Hello guys.Today I tried to make onplayerconnect rules but I have error.

pawn Код:
C:\Documents and Settings\Administrator\My Documents\unique server mod\gamemodes\gangwars.pwn(2535) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\unique server mod\gamemodes\gangwars.pwn(11436) : error 017: undefined symbol "kick"
Here is my code

OnPlayerConnect
pawn Код:
ShowPlayerDialog(playerid, 552, DIALOG_STYLE_MSGBOX, "RULES", "Не ползвай хакове.\nНедей спами.\nНедей рекламирай сървъри.\nНедей ползвай скриптове/клео модове.\nНедей да обиждаш.\nНедей да ползваш модове които ти дават предимство пред другите играчи.\nЗабавлявай се :).","{00BF00}Приемам", "{FF0000}Отказвам");
OnDialogResponse

pawn Код:
if(listitem == 0)
            {
            SendClientMessage(playerid,0x11DB1CFF, "Ти прие правилата!");

            }
            if(listitem == 1)
            {
            SendClientMessage(playerid, COLOR_RED, "Ти отказа да приемеш правилата и беше изгонен от играта!");
            kick(playerid)
Thanks in advance
Reply
#2

should be like this

pawn Код:
Kick(playerid);
not

pawn Код:
kick(playerid)
and that unreachable code

pawn Код:
switch(listitem)
{
     case 0:
    {
         //Codes
    }
     //Put your case here!
}
Reply
#3

Thanks for the help but I don't know how to post this code.This is what I make.

pawn Код:
switch(listitem == 0)
    {
     case 0:
    {
    ShowPlayerDialog(playerid, 552, DIALOG_STYLE_MSGBOX, "RULES", "Не ползвай хакове.\nНедей спами.\nНедей рекламирай сървъри.\nНедей ползвай скриптове/клео модове.\nНедей да обиждаш.\nНедей да ползваш модове които ти дават предимство пред другите играчи.\nЗабавлявай се :).","{00BF00}Приемам", "{FF0000}Отказвам");
    }
}
    return 1;
}
Reply
#4

translate it the word to english
Reply
#5

pawn Код:
ShowPlayerDialog(playerid, 522,DIALOG_STYLE_MSGBOX,"RULES:","Don't use hacks\nDon't swear.\nDon't advertise\nDon't use scripts or Cleo mods.\nDo not use mods that give you an advantage over other players,"Accept","Cancel"
Reply
#6

Show ALL of the code.
Reply
#7

unreachable code caused because at the end of the case or if statement you return a value that it stop to continue and you return another value under the cases/if-else statements.
Reply
#8

OnPlayerConnect - http://pastebin.com/g7Hgf8bE

OnDialogResponse - http://pastebin.com/e9jDsJfA
Reply
#9

SOLVED.Thanks to MasterJocker and Dwane. +1 REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)