SA-MP Forums Archive
PD Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PD Problem (/showthread.php?tid=180554)



PD Problem - Luis- - 01.10.2010

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?


Re: PD Problem - Scenario - 01.10.2010

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.


Re: PD Problem - Nero_3D - 01.10.2010

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


Re: PD Problem - Memoryz - 01.10.2010

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...