Someone help please
#1

i tried a [FS] earlier witch would let only a play with a certian name enter a car. it didnt work because it gave me errors and i cldnt seem to fix them.

can someone PLEASE give me a link to one because ii cant find one and this will finish my server

thanks,

Roney
Reply
#2

Something like this:
pawn Код:
//top of script
new car;

//OnGameModeInit
car = CreateVehicle(..); // or AddStaticVehicle

//OnPlayerEnterVehicle
if(vehicleid == car)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, sizeof name);
  if(strcmp(name, "desired name here", true) != 0)
  {
   RemovePlayerFromVehicle(playerid);
  }
}
Untested.
Reply
#3

i will try. thank you
Reply
#4

ok it didnt work. i can enter other peoples cars. it doesnt give me any warning
Reply
#5

That only disallows you to enter the selected car, unless your name is whatever you put in the quotation marks.
Reply
#6

i know. but i made more people have this. i can enter their cars and i dont have their name

Reply
#7

Код:
if(strcmp(name, "desired name here", true) != 0)
Hmmm this will be called when the names are NOT the same (strcmp returns a 0 when the strings are equal):
Код:
if(!strcmp(name, "desired name here", true))
Edit: @_Xerxes_: Ohh im not good in english :d
Reply
#8

Quote:
Originally Posted by GTAguillaume
Код:
if(strcmp(name, "desired name here", true) != 0)
Hmmm this will be called when the names are NOT the same (strcmp returns a 0 when the strings are equal):
Код:
if(!strcmp(name, "desired name here", true))
I know, that's why it is "!= 0".
Reply
#9

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == Roney_Remington)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
if(strcmp(name, "Roney_Remington", true) != 0)
{
RemovePlayerFromVehicle(playerid);
}
}


thats what i have. nd i have

new Roney_Remington;

that is at top under includes. then there is

Roney_Remington = AddStaticVehicle(463,-917.7588,2680.2612,41.9102,313.2037,86,86); // tjs bike 3

tht is under gamemodeinit
Reply
#10

it doesnt lock anyone out of any car

i made like 15 cars for 3 people. they can all enter eachothers cars
Reply
#11

someone please help me. my server will be done after this is done
Reply
#12

I forgot..

Use CreateVehicle instead of AddStaticVehicle, that should do it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)