[HELP]Anti going in some cars.... - 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: [HELP]Anti going in some cars.... (
/showthread.php?tid=130979)
[HELP]Anti going in some cars.... -
MaykoX - 01.03.2010
Hey i'm working on some code that only ranks Private 2nd can go in. And it's not working -.-. (I know i use >>Sandra<<'s inc [RANKS] but i think it's something wrong with code.)
Here is code :
Код:
//on top
forward PC(playerid);
//on gamemodeint
SetTimer("PC", 1000, true);
//bottom of script
public PC(playerid) //PlayerCheck
{
for(new i=0;i<MAX_PLAYER;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
new vehicleid = GetPlayerVehicleID(i);
new denied=0;
new Float:x, Float:y, Float:z;
GetPlayerPos(i, x, y, z);
if(GetVehicleModel(vehicleid) == 432)
{
if(GetPlayerRank(playerid) == 3)
{
GameTextForPlayer(i, "~w~Rank: ~b~Private 2st Class~r~ needed~w~!", 2000, 3);
denied = 1;
}
}
if(denied == 1)
{
SetPlayerToPos(i, x, y, z+1);
RemovePlayerFromVehicle(i);
}
}
}
}
return 1;
}
Re: [HELP]Anti going in some cars.... -
MaykoX - 01.03.2010
BumPy Bump, 12 hours passed