27.10.2010, 03:46
#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
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