SA-MP Forums Archive
Help FS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help FS (/showthread.php?tid=567996)



Help FS - sahrul012 - 18.03.2015

Help Me Fix This Problem..

Here My Error..
PHP код:
C:\Users\Acer\Desktop\SAMP\pawno\tunecar.pwn(21) : error 036: empty statement 

Line 21
PHP код:
public OnPlayerCommandText(playeridcmdtext[]) {
    if(
strcmp(cmdtext"/tunecar"true) == 0) {
        If(
IsPlayerVipType(playerid,2)); // Line 21
        
new playerstate GetPlayerState(playerid);
        if(
playerstate == PLAYER_STATE_DRIVER) {
        return 
ModCar(playerid);
        }
        else {
        return 
SendClientMessage(playeridCOLOR_RED"[ERROR]: You must be in a car being the driver Or You Not Gold VIP");
        }
    }
    return 
1;




Re: Help FS - iFiras - 18.03.2015

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/tunecar", true) == 0)
    {
        if(IsPlayerVipType(playerid,2))
        new playerstate = GetPlayerState(playerid);
        if(playerstate == PLAYER_STATE_DRIVER)
        {
            return ModCar(playerid);
        }
        else
        {
            return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You must be in a car being the driver Or You Not Gold VIP");
        }
    }
    return 1;
}
You shouldn't be using "if" as "If", case sensitivity is required.
In addition, you shouldn't use a semicolon in "if" statements.


Re: Help FS - CalvinC - 18.03.2015

First, you shouldn't have a semicolon in an if ( the ; )
Second, you should make the if actually trigger something, like
pawn Код:
if(IsPlayerVipType(playerid, 2))
{
    // Code
}
And remember that PAWN is case sensitive, so don't use "If"


Re: Help FS - sahrul012 - 18.03.2015

i get this error..
Quote:

C:\Users\Acer\Desktop\SAMP\pawno\tunecar.pwn(24) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Acer\Desktop\SAMP\pawno\tunecar.pwn(24) : error 017: undefined symbol "playerstate"
C:\Users\Acer\Desktop\SAMP\pawno\tunecar.pwn(25) : error 017: undefined symbol "playerstate"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Line 24 and 25
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/tunecar"true) == 0)
    {
    if(
IsPlayerVipType(playerid,2))
        new 
playerstate GetPlayerState(playerid); // 24
        
if(playerstate == PLAYER_STATE_DRIVER//25
        
{
        return 
ModCar(playerid);
        }
        else
        {
        return 
SendClientMessage(playeridCOLOR_RED"[ERROR]: You must be in a car being the driver Or You Not Gold VIP");
        }
    }
    return 
1;




Re: Help FS - CalvinC - 18.03.2015

Show more of the code.


Re: Help FS - Rockyyy - 18.03.2015

as i see u used it only once so u can use this code instead

Код:
if(GetPlayerState(playerid)== PLAYER_STATE_DRIVER) {



Re: Help FS - iFiras - 18.03.2015

Try this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new playerstate = GetPlayerState(playerid);
    if(strcmp(cmdtext, "/tunecar", true) == 0)
    {
        if(IsPlayerVipType(playerid,2))
            if(playerstate == PLAYER_STATE_DRIVER)
            {
                return ModCar(playerid);
            }
            else
            {
                return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You must be in a car being the driver Or You Not Gold VIP");
            }
    }
    return 1;
}



Re: Help FS - sahrul012 - 18.03.2015

ok i will test it..if it work +1Rep