Own Car
#1

i were doing script which i can have my own car but orhers can get into my car i wanna do like save car position and have my own car just people with Name or Tag can go into that car

can someone help me pls to do that FS



and srry for bad english
Reply
#2

What have you done untill now?
Reply
#3

Use OnPlayerEnterVehicle/OnPlayerStateChange and remove them when they get in that vehicle or in OnPlayerConnect, SetVehicleParamsForPlayer if thier name isnt a specified name
Reply
#4

Код:
#include <a_samp>

#if defined FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFAA

new tomo;

public OnFilterScriptInit()
{
	print("\n------------------------");
	print("Masinu rezervacija by eMs_");
	print("------------------------\n");
	return 1;
}

public OnGameModeInit()
{
	tomo = CreateVehicle(444,-2534.7346,-616.5275,132.9338,269.4894,122,76,120); // monstras

	return 1;
}


public OnPlayerSpawn(playerid)
{
		SendClientMessage(playerid, COLOR_WHITE, "Masinu rezervuacijos scriptas by eMs_");
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if (vehicleid == tomo)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if (strcmp(name, "eMs_")) RemovePlayerFromVehicle(playerid);
}
return 1;
}
#endif
srry is not in english
Reply
#5

pawn Код:
#include <a_samp>

#define COLOR_WHITE 0xFFFFFFAA

new tomo;

public OnFilterScriptInit()
{
    print("\n------------------------");
    print("Masinu rezervacija by eMs_");
    print("------------------------\n");
    return 1;
}

public OnGameModeInit()
{
    tomo = CreateVehicle(444,-2534.7346,-616.5275,132.9338,269.4894,122,76,120); // monstras
    return 1;
}

public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, "eMs_", false) == 0)
{
SetVehicleParamsForPlayer(tomo,playerid,0,1);
}
return 1;
}
Try that, That will lock the vehicle for everyone else but you
Reply
#6

doe't work
Reply
#7

Does it lock it for you?
Reply
#8

is like other cars everybody can go in
Reply
#9

Quote:
Originally Posted by RemulisLTU
is like other cars everybody can go in
It will be for YOU, If you go on a different name it will be locked
Reply
#10

i am going with diffrent mane everytime
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)