OnPlayerStateChange
#1

I get these errors:
Код:
C:\Users\Keegan\Desktop\filterscripts\MWFFATeams.pwn(213) : error 001: expected token: ")", but found "{"
C:\Users\Keegan\Desktop\filterscripts\MWFFATeams.pwn(221) : error 001: expected token: ")", but found "{"
C:\Users\Keegan\Desktop\filterscripts\MWFFATeams.pwn(229) : error 001: expected token: ")", but found "{"
C:\Users\Keegan\Desktop\filterscripts\MWFFATeams.pwn(237) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
With this code:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 432)
        {
            if(GetPlayerScore(playerid) < 50)
            { //Line 213
                SendClientMessage(playerid, COLOR_RED, "You need to gain 50 score to drive Tanks");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 425)
        {
            if(GetPlayerScore(playerid) < 30)
            { //Line 221
                SendClientMessage(playerid, COLOR_RED, "You need to gain 30 score to pilot Hunters");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 520)
        {
            if(GetPlayerScore(playerid) < 25)
            { //Line 229
                SendClientMessage(playerid, COLOR_RED, "You need to gain 25 score to pilot Hydras");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 447)
        {
            if(GetPlayerScore(playerid) < 15)
            { //Line 237
                SendClientMessage(playerid, COLOR_RED, "You need to gain 15 score to pilot Seasparrows");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}

What is the problem?
Reply
#2

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 432))
        {
            if(GetPlayerScore(playerid) < 50)
            { //Line 213
                SendClientMessage(playerid, COLOR_RED, "You need to gain 50 score to drive Tanks");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 425))
        {
            if(GetPlayerScore(playerid) < 30)
            { //Line 221
                SendClientMessage(playerid, COLOR_RED, "You need to gain 30 score to pilot Hunters");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 520))
        {
            if(GetPlayerScore(playerid) < 25)
            { //Line 229
                SendClientMessage(playerid, COLOR_RED, "You need to gain 25 score to pilot Hydras");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid) == 447))
        {
            if(GetPlayerScore(playerid) < 15)
            { //Line 237
                SendClientMessage(playerid, COLOR_RED, "You need to gain 15 score to pilot Seasparrows");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
Reply
#3

if(GetVehicleModel(GetPlayerVehicleID(playerid) == 432))
Reply
#4

This will work,rep me + if i helped you

Quote:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid) == 432))
{
if(GetPlayerScore(playerid) < 50))
{ //Line 213
SendClientMessage(playerid, COLOR_RED, "You need to gain 50 score to drive Tanks");
RemovePlayerFromVehicle(playerid);
}
}
if(GetVehicleModel(GetPlayerVehicleID(playerid) == 425))
{
if(GetPlayerScore(playerid) < 30))
{ //Line 221
SendClientMessage(playerid, COLOR_RED, "You need to gain 30 score to pilot Hunters");
RemovePlayerFromVehicle(playerid);
}
}
if(GetVehicleModel(GetPlayerVehicleID(playerid) == 520))
{
if(GetPlayerScore(playerid) < 25))
{ //Line 229
SendClientMessage(playerid, COLOR_RED, "You need to gain 25 score to pilot Hydras");
RemovePlayerFromVehicle(playerid);
}
}
if(GetVehicleModel(GetPlayerVehicleID(playerid) == 447))
{
if(GetPlayerScore(playerid) < 15))
{ //Line 237
SendClientMessage(playerid, COLOR_RED, "You need to gain 15 score to pilot Seasparrows");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}

Reply
#5

oh!! i fix it!!!!!

Quote:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == jcar1 )
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName,"ShadowReaper",true))return RemovePlayerFromVehicle(playerid),SendClientMessag e(playerid, COLOR_RED, "[VEHICLE]:{FFFFFF}You can't drive this car,this car is owned by ShadowReaper.");
{
SendClientMessage(playerid, COLOR_LIMEGREEN, "[VEHICLE]:{FFFFFF}Welcome back to your owned car.");
}
}
if(CarCheck == jcar2)
{
new PlayerName[24];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(strcmp(PlayerName,"ShadowReaper",true))return RemovePlayerFromVehicle(playerid),SendClientMessag e(playerid, COLOR_RED, "[VEHICLE]:{FFFFFF}You can't drive this car,this car is owned by ShadowReaper.");
{
SendClientMessage(playerid, COLOR_LIMEGREEN, "[VEHICLE]:{FFFFFF}Welcome back to your owned car.");
}
return 1;
}
return 0;
}

Reply
#6

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 432)
        {
            if(GetPlayerScore(playerid) < 50)
            { //Line 213
                SendClientMessage(playerid, COLOR_RED, "You need to gain 50 score to drive Tanks");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 425)
        {
            if(GetPlayerScore(playerid) < 30)
            { //Line 221
                SendClientMessage(playerid, COLOR_RED, "You need to gain 30 score to pilot Hunters");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 520)
        {
            if(GetPlayerScore(playerid) < 25)
            { //Line 229
                SendClientMessage(playerid, COLOR_RED, "You need to gain 25 score to pilot Hydras");
                RemovePlayerFromVehicle(playerid);
            }
        }
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 447)
        {
            if(GetPlayerScore(playerid) < 15)
            { //Line 237
                SendClientMessage(playerid, COLOR_RED, "You need to gain 15 score to pilot Seasparrows");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)