SA-MP Forums Archive
[HELP] Vehicle lock - 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: [HELP] Vehicle lock (/showthread.php?tid=71996)



[HELP] Vehicle lock - Frankox - 05.04.2009

I want to make a vehicle to be locked for every play just not for admins and for a player who own that vehicle :

OnGameModeInIt()

if(GetPlayerName(playerid) == Franko)
{
AddStaticVehicle(521,1828.1996,-1688.3999,13.1021,305.5544,75,13); // test
}
else
{
SendClientMessage(playerid,COLOR_DBLUE,"You cant enter this vehicle, Franko is the owner of it");
}


whats wrong with this? i want vehicle to be locked for everyone just not for player named "Franko"



Re: [HELP] Vehicle lock - dre$tA - 05.04.2009

Код:
// On top of the script
new LockVeh;
forward AdminCheck(playerid);
Код:
public OnGameModeInit()
{
	LockVeh = AddStaticVehicle(521,1828.1996,-1688.3999,13.1021,305.5544,75,13); // test
	return 1;
}
Код:
public OnPlayerConnect(playerid)
{
	new name[24];
	GetPlayerName(playerid, name, 24);
	if(strcmp(name, "Franko", true, 24) == 0)
	{
		SetVehicleParamsForPlayer(LockVeh, playerid, 0, true);
	}
	else
	{
	  SetVehicleParamsForPlayer(LockVeh, playerid, 0, false);
	}
	SetTimerEx("AdminCheck", 2000, 1, "i", playerid);
	return 1;
}
Код:
public AdminCheck(playerid)
{
	if(IsPlayerAdmin(playerid))
	{
	  SetVehicleParamsForPlayer(LockVeh, playerid, 0, false);
	}
	else
	{
	  SetVehicleParamsForPlayer(LockVeh, playerid, 0, true);
	}
}



Re: [HELP] Vehicle lock - Frankox - 05.04.2009

Tnx