Help FS
#1

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;

Reply
#2

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.
Reply
#3

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"
Reply
#4

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;

Reply
#5

Show more of the code.
Reply
#6

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

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

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;
}
Reply
#8

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


Forum Jump:


Users browsing this thread: 2 Guest(s)