OnPlayerState
#1

Guys Im Trying To Make A Police System How To Fix This Anyone Please Help Me
Quote:

new carid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && if((carid <= 407) && (carid <= 427) || (carid <= 432) || (carid <= 433) && (carid <= 490) || (carid >= 497) && (carid >= 523) || (carid >= 52 && (carid <= 596) || (carid >= 597) && (carid <= 59 && (carid <= 599) && (carid <= 601));
{
if(AccInfo[playerid][Police] == 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,0xFF0000FF,"Police Only!");
}
}

Reply
#2

Код:
if((carid <= 407)
You needn't add an if when you are using the logical operators.
Код:
if(cond-1 && cond-2 && cond-3... && cond-n)
You must not add a ; after if statements.

Код:
if(cond) //No ;
{

}
Reply
#3

I'm didn't understand
Reply
#4

Use This:
PHP код:
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new 
carid GetPlayerVehicleID(playerid);
        if(
carid == 407 || carid == 427 || carid == 432 || carid == 433 || carid == 490 || carid == 497 || carid == 523 || carid == 52 || carid == 596 || carid == 597 || carid == 59 || carid == 599 || carid == 601)
        {
            if(
AccInfo[playerid][Police] == 0)
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playerid,0xFF0000FF,"Police Only!");
            }
        }
    } 
Reply
#5

It Didn't Work
Reply
#6

Quote:
Originally Posted by Harith
Посмотреть сообщение
It Didn't Work
You created cars IDs:
Код:
 if(carid == 407 || carid == 427 || carid == 432 || carid == 433 || carid == 490 || carid == 497 || carid == 523 || carid == 52 || carid == 596 || carid == 597 || carid == 59 || carid == 599 || carid == 601)
?
Reply
#7

try this

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
        new carid = GetPlayerVehicleID(playerid);
        new Model = GetVehicleModel(carid);
        if(Model == 407 || Model == 427 || Model == 432 || Model == 433 || Model == 490 || Model == 497 || Model == 523 || Model == 52 || Model == 596 || Model == 597 || Model == 59 || Model == 599 || Model == 601)
        {
            if(AccInfo[playerid][Police] == 0)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,0xFF0000FF,"Police Only!");
            }
        }
}
Reply
#8

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
try this

pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
        new carid = GetPlayerVehicleID(playerid);
        new Model = GetVehicleModel(carid);
        if(Model == 407 || Model == 427 || Model == 432 || Model == 433 || Model == 490 || Model == 497 || Model == 523 || Model == 52 || Model == 596 || Model == 597 || Model == 59 || Model == 599 || Model == 601)
        {
            if(AccInfo[playerid][Police] == 0)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,0xFF0000FF,"Police Only!");
            }
        }
}
Where did you see the model number below 400?

Код:
Model == 52  ... || ... Model == 59
So it comes to ID!
Reply
#9

Maybe Its My Fault Wrong Type
Reply
#10

Its not my problem he asked about solution so its it and i don't care what he put in his code i just given him a solution.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)