Code Doesnt Work - 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: Code Doesnt Work (
/showthread.php?tid=89830)
Code Doesnt Work -
Kyle - 04.08.2009
This dont work i wanted it so the car ids there dont let you drive but anythin else than that lets you drive so i tested drivign the nrg but it still lets me drive
http://pastebin.com/m6d70d6fb
Quote:
new carid = GetPlayerVehicleID(playerid);
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && gTeam[playerid] == TEAM_PRES)
{
if(carid == 592 || carid == 577 || carid == 511 || carid == 512 || carid == 593 || carid == 520 || carid == 553 || carid == 476 || carid == 460 || carid == 513 || carid == 548 || carid == 525 || carid == 417 || carid == 487 || carid == 488 || carid == 497 || carid == 563 || carid == 447 || carid == 469 || carid == 522)
{
SendClientMessage(playerid,COLOR_LIGHTGREEN,"You cannot drive while you are The President. You have been removed");
RemovePlayerFromVehicle(playerid);
}
else
{
}
}
|
Re: Code Doesnt Work -
JaTochNietDan - 04.08.2009
GetPlayerVehicleID gets the ID of the vehicle, you look like you're trying to restrict models, you need to use GetVehicleModel for that!
Example:
http://pastebin.com/m702ec0c