Help[Rep]
#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


Messages In This Thread
Help[Rep] - by Dan_Barocu - 17.02.2012, 22:49
Re: Help[Rep] - by Dan_Barocu - 17.02.2012, 23:32
Re: Help[Rep] - by ReneG - 17.02.2012, 23:46
Re: Help[Rep] - by Dan_Barocu - 17.02.2012, 23:48
Re: Help[Rep] - by ReneG - 17.02.2012, 23:55
Re: Help[Rep] - by Dan_Barocu - 18.02.2012, 00:02
Re: Help[Rep] - by ReneG - 18.02.2012, 00:04
Re: Help[Rep] - by Dan_Barocu - 18.02.2012, 00:07
Re: Help[Rep] - by HighFlyer - 18.02.2012, 00:08
Re: Help[Rep] - by Dan_Barocu - 18.02.2012, 00:12

Forum Jump:


Users browsing this thread: 1 Guest(s)