PD Problem
#1

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new string[128];
    new CopSkin = GetPlayerSkin(playerid);
    if(IsACopCar(599 || 598))
    {
        if(g_iJob[ playerid ] == JOB_POLICE)
        {
            if (CopSkin == 280 || CopSkin == 281 || CopSkin == 282 || CopSkin == 283)
            {
                format(string,sizeof(string),"This Vehicle Is Owned By Fort Carson Sheriff Dept", string);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are not a Cop.");
                return 1;
            }
            return 1;
        }
        return 1;
    }
}
RemovePlayerFromVehicle(playerid); dose not work?
Reply
#2

pawn Код:
if (CopSkin == 280 || CopSkin == 281 || CopSkin == 282 || CopSkin == 283)
            {
                format(string,sizeof(string),"This Vehicle Is Owned By Fort Carson Sheriff Dept", string);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are not a Cop.");
                return 1;
            }
            return 1;
To this...

pawn Код:
if (CopSkin == 280 || CopSkin == 281 || CopSkin == 282 || CopSkin == 283)
            {
                format(string,sizeof(string),"This Vehicle Is Owned By Fort Carson Sheriff Dept", string);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                return 1;
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are not a Cop.");
                return 1;
            }
I don't think you need to include the "return 1;" at the end of that if statement.
Reply
#3

The player is only entering so he isnt in the vehicle and so he cant be removed
Reply
#4

Also, looking at the code.

Why do you need to

pawn Код:
format(string,sizeof(string),"This Vehicle Is Owned By Fort Carson Sheriff Dept", string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
There are no variables in that so you can just use a regular sendclientmessage, no formatting needed...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)