Help[Rep]
#1

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!
Reply
#2

please help ..
Reply
#3

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

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..
Reply
#5

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

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

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.
Reply
#8

can you make it in strcmp??
Reply
#9

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)