SA-MP Forums Archive
Own Car - 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: Own Car (/showthread.php?tid=68017)



Own Car - [LNL]Remulis - 06.03.2009

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


Re: Own Car - MenaceX^ - 06.03.2009

What have you done untill now?


Re: Own Car - ICECOLDKILLAK8 - 06.03.2009

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


Re: Own Car - [LNL]Remulis - 06.03.2009

Код:
#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


Re: Own Car - ICECOLDKILLAK8 - 06.03.2009

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


Re: Own Car - [LNL]Remulis - 06.03.2009

doe't work


Re: Own Car - ICECOLDKILLAK8 - 06.03.2009

Does it lock it for you?


Re: Own Car - [LNL]Remulis - 06.03.2009

is like other cars everybody can go in


Re: Own Car - ICECOLDKILLAK8 - 06.03.2009

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


Re: Own Car - [LNL]Remulis - 06.03.2009

i am going with diffrent mane everytime