Weird problem
#1

So guys I'm making a little newsstand script with a dialog in my gamemode and I'm getting some weird errors idk why I tried to figure it out but it's not working...Can somebody help me?

This is the ShowPlayerDialog function on /newsstand

Код:
ShowPlayerDialog(playerid, DIALOG_KIOSK, DIALOG_STYLE_LIST, "Kiosk", "1)Mars cokoladica $30\n2)Snickers cokoladica $32\n3)Fanta $28\n4)Coca Cola $29\n5)Kredit 100\n6)Kredit 200\n7)Kartica MTS $50\n8)Cigarete $100\n9)Upaljac $35", "Ok", "Izlaz");
And this is public OnDialogResponse

Код:
if(dialogid == DIALOG_KIOSK && response)
{
    switch(listitem)
    {
        case 0:GivePlayerMoney(playerid, -30); SCM(playerid, 0xC8D69AFF, "Pojeli ste Mars cokoladicu!");             SetPlayerHealth(playerid, GetPlayerHealth(playerid) + 30);
        case 1:GivePlayerMoney(playerid, -32); SCM(playerid, 0xC8D69AFF, "Pojeli ste Snickers cokoladicu!");    SetPlayerHealth(playerid, GetPlayerHealth(playerid) + 33);
    }
}
And finally here are the errors

Код:
D:\Samp server\gamemodes\BalkanKingRP.pwn(4503) : error 002: only a single statement (or expression) can follow each "case"
D:\Samp server\gamemodes\BalkanKingRP.pwn(4503) : warning 215: expression has no effect
D:\Samp server\gamemodes\BalkanKingRP.pwn(4503) : warning 202: number of arguments does not match definition
D:\Samp server\gamemodes\BalkanKingRP.pwn(4504) : error 014: invalid statement; not in switch
D:\Samp server\gamemodes\BalkanKingRP.pwn(4504) : warning 215: expression has no effect
D:\Samp server\gamemodes\BalkanKingRP.pwn(4504) : error 001: expected token: ";", but found ":"
D:\Samp server\gamemodes\BalkanKingRP.pwn(4504) : error 029: invalid expression, assumed zero
D:\Samp server\gamemodes\BalkanKingRP.pwn(4504) : fatal error 107: too many error messages on one line
I didn't make all cases cuz of errors... I tried but it gave me many more of them...
Reply
#2

Change all ; to , except last one after SetPlayerHealth or put code in brackets
pawn Код:
case 0:
{
// code
}
Reply
#3

Oh yeah it's ok now thx..
Reply
#4

Off topic, but I was surprised at your English after seeing the second language in the script, lol. Most people on here speak like, "So guys I maked script and I get error, I not know how fix, please fix error thanks."
Reply
#5

Hahahhah yeah I know.. Thanks man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)