SA-MP Forums Archive
Private vehicle 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: Private vehicle problem! (/showthread.php?tid=185998)



Private vehicle problem! - BigAl - 27.10.2010

#include <a_samp>

new privatecar;

public OnFilterScriptInit()
{
privatecar = AddStaticVehicleEx(409,3963.05175781,-1602.40466309,3.30965090,0.00000000,-1,-1,15);
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);

if(newstate == PLAYER_STATE_DRIVER)
{
if(strcmp(GetName(playerid),"[G2x}BigAl", false) == 0)
{
if(vehicleid == privatecar)
{
return 1;
}
else
{
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}

stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
return name;
}


^^ that is my script and i have a slight problem with it. When i compile i get no errors but this is supposed to be a private vehicles specifically for me ([G2x]BigAl) and i have tried it with false and true. When i enter any vehicle it kicks me right out of the vehicle and everytime i try to get back init it fails and i get kicked back out.


Please help solve my problem, thanks.


BigAl


Re: Private vehicle problem! - Steven82 - 27.10.2010

Have you read the private car tutorials?

https://sampforum.blast.hk/showthread.php?tid=185612 - 1

https://sampforum.blast.hk/showthread.php?tid=100016 - 2

https://sampforum.blast.hk/showthread.php?tid=113804 - 3

Thats a total of 3 tutorials of me searching, and some of them are using simpler easier coding.


Re: Private vehicle problem! - BigAl - 27.10.2010

Thanks for trying to help, i did try and i couldn't seem to get it right, but sorted it now thanks!