Missing: }
#1

Can anybody see where i forgot a }?

In this code:

Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1957 && response == 1)
{
if(listitem == 0)
{
if(freegift[playerid] == 0)
{
GivePlayerWeapon(playerid, 31, 5000);
SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen a M4! In 4 hours you can choose another gift!");
SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
something[playerid] = 1;
return 1;
}
else if(freegift[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
}
if(listitem == 1)
{
if(freegift[playerid] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
GivePlayerMoney(playerid, 100000);
something[playerid] = 1;
return 1;
}
else if(freegift[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
}
if(listitem == 2)
{
if(freegift[playerid] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen 250 score! In 4 hours you can choose another gift!");
SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 250);
SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
something[playerid] = 1;
return 1;
}
else if(freegift[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
}

(theres also a bit code from dialogresponse under this, but that works perfect)

Thankz
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1957 && response == 1)
    {
        if(listitem == 0)
        {
            if(freegift[playerid] == 0)
            {
                GivePlayerWeapon(playerid, 31, 5000);
                SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen a M4! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
                something[playerid] = 1;
                return 1;
            }
            else if(freegift[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
            }
        } //here
        if(listitem == 1)
        {
            if(freegift[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
                GivePlayerMoney(playerid, 100000);
                something[playerid] = 1;
                return 1;
            }
            else if(freegift[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
            }
        } // here
        if(listitem == 2)
        {
            if(freegift[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen 250 score! In 4 hours you can choose another gift!");
                SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + 250);
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                something[playerid] = 1;
                return 1;
            }
            else if(freegift[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
            }
        }
    }
    return 1;
}
Reply
#3

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1957 && response == 1)
    {
        if(listitem == 0)
        {
            if(freegift[playerid] == 0)
            {
                GivePlayerWeapon(playerid, 31, 5000);
                SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen a M4! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
                something[playerid] = 1;
                return 1;
            }
            else if(freegift[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
            }
        }
        if(listitem == 1)
        {
            if(freegift[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
                GivePlayerMoney(playerid, 100000);
                something[playerid] = 1;
                return 1;
            }
            else if(freegift[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
            }
        }
        if(listitem == 2)
        {
            if(freegift[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "Serverguid: {00FF15}You have choosen 250 score! In 4 hours you can choose another gift!");
                SetTimerEx("freegifttimer", 14400000, 0,"e",playerid);
                SetPlayerScore(playerid, GetPlayerScore(playerid) + 250);
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                something[playerid] = 1;
                return 1;
            }
            else if(freegift[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_RED, "Serverguid: {00FF15}Serverguid: {00FF15}You have choosen $100,00 cash! In 4 hours you can choose another gift!");
                SetPlayerPos(playerid, 1940.4705,-2267.8896,13.5745);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#4

lol... where is the error message..........show us the line in which u are getting error.....
Reply
#5

Quote:
Originally Posted by ronaldoraul
Посмотреть сообщение
lol... where is the error message..........show us the line in which u are getting error.....
fail lol..
if you forget a } somewhere you get MANY errors with many different lines...
"Missing }" + the code are enough information to fix it...


and 1 advice Penait1:
watch for your indentation (check my version for some ok indentation). this helps you to find those mistakes easier:P
Reply
#6

Quote:
Originally Posted by Sascha
Посмотреть сообщение
fail lol..
if you forget a } somewhere you get MANY errors with many different lines...
"Missing }" + the code are enough information to fix it...


and 1 advice Penait1:
watch for your indentation (check my version for some ok indentation). this helps you to find those mistakes easier:P
thnks for the suggestions.........
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)