hotwire problem +rep
#1

i have hotwire system on my server and want so ppl cannot use /engine on the hotwire car pls help

here is engine cmd

Код:
}
CMD:engine(playerid, params[])
{
    new
        giveplayerid,
        string[128],
        engine,
        lights,
        alarm,
        doors,
        bonnet,
        boot,
        objective,
        vehicleid = GetPlayerVehicleID(playerid);
					    
	vehicleid = GetPlayerVehicleID(playerid);
	if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
	GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
    {
        SetVehicleEngine(vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
    {
        SetTimerEx("SetVehicleEngine", 3500, 0, "dd",  vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
here is hotwire command
Код:
}
CMD:hotwire(playerid, params[])
{
     new
        string[128],
        giveplayerid,
        vehicleid = GetPlayerVehicleID(playerid);
        
	if(PlayerInfo[playerid][pToolKit] == 1 && PlayerInfo[playerid][pHotWire] == 0)
    {
		format(string, sizeof(string), "* %s Grabs the toolkit, then begins to unzip the toolkit", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		SetTimerEx("SetVehicleEngine",5500, 0, "dd",  vehicleid, playerid);
		GameTextForPlayer(playerid, "~w~Hotwiring!", 5500,4);
	}
	if(PlayerInfo[playerid][pToolKit] == 0)
    {
		SendClientMessageEx(playerid, COLOR_GREY, "You need a toolkit to hotwire this car");
    }
    return 1;
Reply
#2

Код:
if(PlayerInfo[playerid][pHotWire] != 0) return SendClientMessage(playerid,color,"You are already hotwiring.");
Reply
#3

Quote:
Originally Posted by coole210
Посмотреть сообщение
[CODE]if(PlayerInfo[playerid][pHotWire] != 0) return SendClientMessage(playerid,color,"You are already hotwiring.");
so i put this on engine cmd? so ppl cannot use /engine cmd on that car.

i want like when you type on hotwire cars you cannot start engine on this car you need to hotwire this car
Reply
#4

Quote:
Originally Posted by PRototype-RP
Посмотреть сообщение
i want like when you type on hotwire cars you cannot start engine on this car you need to hotwire this car
I don't understand. The ending/middle of your sentence is conflicting with the beginning of it. What do you exactly want?
Reply
#5

Quote:
Originally Posted by Steven82
Посмотреть сообщение
I don't understand. The ending/middle of your sentence is conflicting with the beginning of it. What do you exactly want?
okay now I'll explain in detail. I have so you must have toolkit to take cars, but when I go into a car so I can use / engine I want, when you type / engine i say you can not start the engine You Need to Hotwire this vehicle. you understand now what i mean?
Reply
#6

Post your "/engine" command.
Reply
#7

Just set your engine variable to positive, like PlayerInfo[playerid][pEngine] = 1;
Just add that under your hotwire command?
Reply
#8

pawn Код:
CMD:hotwire(playerid, params[])
{
     new
        string[128],
        giveplayerid,
        vehicleid = GetPlayerVehicleID(playerid);
       
    if(PlayerInfo[playerid][pToolKit] == 1 && PlayerInfo[playerid][pHotWire] == 0)
    {
        format(string, sizeof(string), "* %s Grabs the toolkit, then begins to unzip the toolkit", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        SetTimerEx("SetVehicleEngine",5500, 0, "dd",  vehicleid, playerid);
        GameTextForPlayer(playerid, "~w~Hotwiring!", 5500,4);
        PlayerInfo[playerid][pEngine] = 1; // Replace [pEngine] with your variable, and make sure the engine is ON
    }
    if(PlayerInfo[playerid][pToolKit] == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You need a toolkit to hotwire this car");
    }
    return 1;
Reply
#9

Quote:
Originally Posted by Tee
Посмотреть сообщение
Post your "/engine" command.
Код:
}
CMD:engine(playerid, params[])
{
    new
        giveplayerid,
        string[128],
        engine,
        lights,
        alarm,
        doors,
        bonnet,
        boot,
        objective,
        vehicleid = GetPlayerVehicleID(playerid);
					    
	vehicleid = GetPlayerVehicleID(playerid);
	if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
	GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(engine == VEHICLE_PARAMS_ON)
    {
        SetVehicleEngine(vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and turn the vehicle engine off", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
    {
        SetTimerEx("SetVehicleEngine", 3500, 0, "dd",  vehicleid, playerid);
        format(string, sizeof(string), "* %s spins a key and tries to start vehicle engine", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    return 1;
i want so when ppl type /engine i say you need too hotwire this vehicle here is the hotwire vehicle in sirpct

Код:
IsASateCar(carid)
{
	for(new v = 0; v < sizeof(Statecar); v++)
	{
	    if(carid == Statecar[v]) return 1;
	}
	return 0;
Reply
#10

So you want it so when the player enters ANY vehicle, it asked them to hotwire it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)