SA-MP Forums Archive
Not kicking player from vehicle? - 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: Not kicking player from vehicle? (/showthread.php?tid=132977)



Not kicking player from vehicle? - Torran - 10.03.2010

Hello,

Im making a privatecars script and its not kicking me from the truck?
Heres my code, I have it under OnPlayerStateChange

pawn Код:
if (vehicleid == Torran)
{
  if (OwnedCar[playerid] == 1) {
    SendClientMessage(playerid, COLOR_ORANGE, "-------------------");
    SendClientMessage(playerid, COLOR_WHITE, "Welcome to Torran's Truck");
    SendClientMessage(playerid, COLOR_ORANGE, "-------------------");
  }
  else if (OwnedCar[playerid] != 1) {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_RED, "You are not authorized to drive this vehicle");
  }
}
It dosent kick me, Anyone know why?


Re: Not kicking player from vehicle? - [MWR]Blood - 10.03.2010

Instead of RemovePlayerFromVehicle Try to put this
GetPlayerPos(player1,x,y,z);
return SetPlayerPos(player1,x,y,z+3);



Re: Not kicking player from vehicle? - Torran - 10.03.2010

I dont think thats the problem,
As it shows:

pawn Код:
SendClientMessage(playerid, COLOR_ORANGE, "-------------------");
SendClientMessage(playerid, COLOR_WHITE, "Welcome to Torran's Truck");
SendClientMessage(playerid, COLOR_ORANGE, "-------------------");
For people.. Even if its set to 0
Maybe its the way i get the players name?

pawn Код:
if(strcmp("Torran", name, true) == 0)
{



Re: Not kicking player from vehicle? - [MWR]Blood - 10.03.2010

if(GetPlayerName(playerid) == Name here)


Re: Not kicking player from vehicle? - Anwix - 10.03.2010

Quote:
Originally Posted by ikarus
if(GetPlayerName(playerid) == Name here)
That wouldn't work.

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));

if (strcmp(name, "Torran", true))
{
 SendClientMessage(playerid, YELLOW, "Welcome to your vehicle, torran.");
}
else
{
 RemovePlayerFromVehicle(playerid);
 SendClientMessage(playerid, RED, "You are not authorized to use this vehicle.");
}



Re: Not kicking player from vehicle? - Nero_3D - 10.03.2010

Quote:
Originally Posted by Anwix
Quote:
Originally Posted by ikarus
if(GetPlayerName(playerid) == Name here)
That wouldn't work.

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));

if (strcmp(name, "Torran", true))
{
 SendClientMessage(playerid, YELLOW, "Welcome to your vehicle, torran.");
}
else
{
 RemovePlayerFromVehicle(playerid);
 SendClientMessage(playerid, RED, "You are not authorized to use this vehicle.");
}
if (strcmp(name, "Torran", true) == 0)


Re: Not kicking player from vehicle? - ¤Adas¤ - 10.03.2010

Quote:
Originally Posted by ikarus
if(GetPlayerName(playerid) == Name here)
OMG, don't try to help, if you don't know how!


Re: Not kicking player from vehicle? - Jakku - 10.03.2010

Are you sure your code is under: if (newstate == PLAYER_STATE_DRIVER) {

?


Re: Not kicking player from vehicle? - Torran - 10.03.2010

Nevermind fixed it now,
I mispelt removeplayerfromvehicle.. Dnno why it didnt bring errors