SA-MP Forums Archive
Help[Rep] - 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)
+--- Thread: Help[Rep] (/showthread.php?tid=319099)



Help[Rep] - Dan_Barocu - 17.02.2012

ok look hello i need soo much help my command i looked at tutorials i put in this cmd and when i go i type /engineon and i cant drive the car,i cant even move the wheels left,right. IJust want to drive the car /engineon engineoff i simple engine...Please help me fix it [rep]


HERE:

Код:
new engine, lights, alarm, doors, bonnet, boot, objective;

if(strcmp(cmd, "/engine", true) == 0)
	{
	new vid = GetPlayerVehicleID(playerid);
    SendClientMessage(playerid, COLOR_GRAD1, "Engine ON!");
	GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
	SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
    CommandLog(string);
	return 1;
	}
	if(strcmp(cmd, "/engineoff", true) == 0)
	{
	new vid = GetPlayerVehicleID(playerid);
    SendClientMessage(playerid, COLOR_GRAD1, " Engine off!");
	GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
	SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
    TogglePlayerControllable(playerid, 0);
    CommandLog(string);
	return 1;
	}
Please help me fix it![rep]



I Have this a Ongamemodeinit!::: ManualVehicleEngineAndLights(); ::: Please help dont forget im giving rep!


Re: Help[Rep] - Dan_Barocu - 17.02.2012

please help ..


Re: Help[Rep] - ReneG - 17.02.2012

Try deleting
pawn Код:
TogglePlayerControllable(playerid,0);
-_-


Re: Help[Rep] - Dan_Barocu - 17.02.2012

i did..i tried it in 100 times i did delete it and still no work.i cant drive the car but the smoke comes out if the engine is on..


Re: Help[Rep] - ReneG - 17.02.2012

I don't use strcmp very often but try replacing
Код:
cmd
In your strcmp.
With
Код:
cmdtext



Re: Help[Rep] - Dan_Barocu - 18.02.2012

still no its the same for me.. ( do you know an simple engine cmd??


Re: Help[Rep] - ReneG - 18.02.2012

Yes, it is the one from my gamemode. I'll be more than glad to give it to you, but it is in ZCMD format.


Re: Help[Rep] - Dan_Barocu - 18.02.2012

can you make it in strcmp??


Re: Help[Rep] - HighFlyer - 18.02.2012

Quote:

I Have this a Ongamemodeinit!

Do you? If you do, you should know that each command should be defined under public OnPlayerCommandText.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(!strcmp(cmdtext, "/engine", true) == 0)
   {
	new vid = GetPlayerVehicleID(playerid);
        SendClientMessage(playerid, COLOR_GRAD1, "Engine ON!");
	GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
	SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
        CommandLog(string);
        return 1;
    }

    if(!strcmp(cmdtext, "/engineoff", true) == 0)
    {
	new vid = GetPlayerVehicleID(playerid);
        SendClientMessage(playerid, COLOR_GRAD1, " Engine off!");
	GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
	SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
        TogglePlayerControllable(playerid, 0);
        CommandLog(string);
        return 1;
    }
    // any other commands you may have
    return 0;
}
Remember to indent your script, it looks very messy.


Re: Help[Rep] - Dan_Barocu - 18.02.2012

This is under ongamemodeinit Look this: >>> ManualVehicleEngineAndLights();