SA-MP Forums Archive
Dealership Hotwire! - 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: Dealership Hotwire! (/showthread.php?tid=184187)



Dealership Hotwire! - NotoriousMOB - 18.10.2010


Heey

Okay so the thing is i mapped a dealership for planes/helis
and added some buyable Planes and Helicopters

but you can hotwire the dealership vehicles :/..


Re: Dealership Hotwire! - Cameltoe - 18.10.2010

What about posting some code?


Re: Dealership Hotwire! - NotoriousMOB - 18.10.2010

Код:
        if(!strcmp(cmd, "/hotwire", true))
{
if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!");
if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
gEngine[playerid] = 1;
return 1;



Re: Dealership Hotwire! - Cameltoe - 18.10.2010

show me this function: IsAtDealership(playerid)

This forum requires that you wait 120 seconds between posts. Please try again in 20 seconds.


Re: Dealership Hotwire! - NotoriousMOB - 18.10.2010

Код:
public IsAtDealership(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007))
		{
			return 1;
		}
i asume this one.


Re: Dealership Hotwire! - Cameltoe - 18.10.2010

Quote:
Originally Posted by NotoriousMOB
Посмотреть сообщение
Код:
public IsAtDealership(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007))
		{
			return 1;
		}
i asume this one.
And your sure thats the coords?


Re: Dealership Hotwire! - NotoriousMOB - 18.10.2010

yes i didn't touch that part.

i have 3-4 other dealerships
With Cars and Bikes.


Re: Dealership Hotwire! - Cameltoe - 18.10.2010

Quote:
Originally Posted by NotoriousMOB
Посмотреть сообщение
yes i didn't touch that part.

i have 3-4 other dealerships
With Cars and Bikes.
Then im not sure.. what about adding an variable to check if the vehicle is bought?


Re: Dealership Hotwire! - Hash [NL-RP] - 18.10.2010

Код:
        if(!strcmp(cmd, "/hotwire", true))
{
if(engineOn[GetPlayerVehicleID(playerid)]) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Engine already started!");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Your key Please");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Only the driver can do this!");
//if(IsAtDealership(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!"); 
if(pveh == 510) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
if(pveh == 462) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "You don't need to start a bike!");
if(idcar == 59 || idcar == 60) return SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Access denied!");
if(IsAtCarrental(playerid)) return SendClientMessage(playerid, COLOR_DARKRED, "You can't hotwire this vehicle!");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s tries to hotwire the car", sendername);
ProxDetector(30.0, playerid, string, COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_LIGHT_BLUE,COLOR_PURPLE,COLOR_PURPLE);
SetTimerEx("StartingTheVehicle",7000,0,"i",playerid);
GameTextForPlayer(playerid, "~w~Hotwiring The Vehicle...",3500,3);
gEngine[playerid] = 1;
return 1;
Should work now.


Re: Dealership Hotwire! - NotoriousMOB - 18.10.2010

Quote:

Should work now.

Im still able to hotwire it.