/tune error
#1

pawn Код:
CMD:tune(playerid, params[])
{
    new playerstate = GetPlayerState(playerid);
    if(playerstate == PLAYER_STATE_DRIVER)
    {
        ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Paint Jobs\nColors\nHoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "[ERROR] You cannot modify/tune a car unless you are the driver.");    }
        return 1;
    }
    return 0;
}
Код:
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(14508) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
Line 14508: "return 0;"
Reply
#2

You have an extra }
pawn Код:
SendClientMessage(playerid, COLOR_RED, "[ERROR] You cannot modify/tune a car unless you are the driver.");    }
Reply
#3

Quote:
Originally Posted by Antonio144
Посмотреть сообщение
You have an extra }
pawn Код:
SendClientMessage(playerid, COLOR_RED, "[ERROR] You cannot modify/tune a car unless you are the driver.");    }
Код:
C:\Documents and Settings\Owner\Desktop\saserver\gamemodes\DDPDRIFT.pwn(14508) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
It's on the "return 0;" again.
Reply
#4

I don't see a reason for return 0.

Try this. Should work
pawn Код:
CMD:tune(playerid, params[])
{
   new playerstate = GetPlayerState(playerid);
   if(playerstate == PLAYER_STATE_DRIVER) return ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Paint Jobs\nColors\nHoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close");
   else return SendClientMessage(playerid, COLOR_RED, "[ERROR] You cannot modify/tune a car unless you are the driver.");
}
I'm not using ZCMD so i can't test it.
Reply
#5

Quote:
Originally Posted by Antonio144
Посмотреть сообщение
I don't see a reason for return 0.

Try this. Should work
pawn Код:
CMD:tune(playerid, params[])
{
   new playerstate = GetPlayerState(playerid);
   if(playerstate == PLAYER_STATE_DRIVER) return ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Paint Jobs\nColors\nHoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close");
   else return SendClientMessage(playerid, COLOR_RED, "[ERROR] You cannot modify/tune a car unless you are the driver.");
}
I'm not using ZCMD so i can't test it.
It works now thanks! Here have some rep. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)