Private vehicle problem!
#1

#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
Reply
#2

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.
Reply
#3

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


Forum Jump:


Users browsing this thread: 2 Guest(s)