Simple Errors:P - Forgot how to make them lol.
#1

So um I have this command:

pawn Код:
YCMD:buynitro(playerid, params[])
{
    if(IsPlayerDriver(playerid)) else return SCM(playerid, COLOR_GREY, "You're not in a vehicle");
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -216.4033,1048.0056,19.7422)) else return SCM(playerid, COLOR_GREY, "You're not at Nitrous Shop");
        {
            if(PlayerInfo[playerid][VehNitro] == 0) else return SCM(playerid, COLOR_GREY, "You already have Nitrous in your vehicle.");
            {
                PlayerInfo[playerid][VehNitro] = 1;
            }
        }
    }
    return 1;
}
I am sure that there is something wrong with the " else return " after every function there, so I forgot how to make them, Can you fix that for me please?

Error log:

pawn Код:
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2417) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2417) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2417) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2418) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2419) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2419) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2419) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2420) : warning 225: unreachable code
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2421) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2421) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2421) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Administrator\My Documents\Downloads\samp03dsvr_R2_win32\gamemodes\bc.pwn(2422) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Reply
#2

remove else return, leave just return there
Reply
#3

show the line
Reply
#4

Hmm never made it like you did, just try it like this:
pawn Код:
YCMD:buynitro(playerid, params[])
{
    if(IsPlayerDriver(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, -216.4033,1048.0056,19.7422))
        {
            if(PlayerInfo[playerid][VehNitro] == 0)
            {
                PlayerInfo[playerid][VehNitro] = 1;
        return 1;
            }
        else return SCM(playerid, COLOR_GREY, "You already have Nitrous in your vehicle.");
        }
    else return SCM(playerid, COLOR_GREY, "You're not at Nitrous Shop");   
    }
    else return SCM(playerid, COLOR_GREY, "You're not in a vehicle");      
}
Reply
#5

Quote:
Originally Posted by James Coral
Посмотреть сообщение
show the line
He quite clearly stated "else return" as the identifying line. Please learn to read.

OT: FireCat's [should] will work.

:: "This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.", just mean Mr. Forum!
Reply
#6

Fixed over teamviewer by me..
Reply
#7

@FireCat: Yeah I used to make it like that, but I want a simple and modern way . Thank you :3.
@Mike: Thank you buddy <3.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)