[Ajuda] Keys Car !
#1

Entгo pessoal queria ajuda em uma key para ligar o carro...
queria colocar para ligar o carro em ''Y''.
Код:
	if(strcmp(cmd, "/motor",true) == 0)
	{
    	new vid = GetPlayerVehicleID(playerid);
		if(IsPlayerInAnyVehicle(playerid))
		{
		    if(EngineCarro[vid] == 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		    {
		        new viados[MAX_PLAYER_NAME];
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            	SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
            	SendClientMessage(playerid, 0xFFFFFFAA, "Motor {2F991A}Ligado!");
            	EngineCarro[vid] = 1;
            	GetPlayerName(playerid, viados, sizeof(viados));
				format(string, sizeof(string), "* %s Girou a chave e ligou o veiculo.", viados);
			    ProxDetector(20.0, playerid, string, ROXO,ROXO,ROXO,ROXO,ROXO);

    		}
			else if(EngineCarro[vid] == 1 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
                new viados[MAX_PLAYER_NAME];
                GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            	SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
            	SendClientMessage(playerid, 0xFFFFFFAA, "Motor {E31919}Desligado!");
            	EngineCarro[vid] = 0;
                GetPlayerName(playerid, viados, sizeof(viados));
				format(string, sizeof(string), "* %s Girou a chave e desligou o veiculo.", viados);
			    ProxDetector(20.0, playerid, string, ROXO,ROXO,ROXO,ROXO,ROXO);
			}
		}
    	return 1;
   	}
Код:
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        SetCameraBehindPlayer(playerid);
    }
    if(newstate == PLAYER_STATE_DRIVER && VeiculoValido[GetPlayerVehicleID(playerid)] == 1)
    {
            SendClientMessage(playerid,COLOR_WHITE, "* {00CD00}Vocк pode ativar a cвmera em 1Є pessoa apertando a letra Y.");
    }
    if(newstate == PLAYER_STATE_DRIVER)
	{
			SendClientMessage(playerid,COLOR_WHITE, "* Para LIGAR OU DESLIGAR seu veiculo, aperte 'CTRL' Ou digite /motor.");

	}
Reply
#2

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_YES)
    {
         return 
OnPlayerCommandText(playerid"/motor");
    }
    return 
true;

Reply
#3

Quote:
Originally Posted by Glederson_dom
Посмотреть сообщение
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_YES)
    {
         return 
OnPlayerCommandText(playerid"/motor");
    }
    return 
true;

Pawno fica parando de funcionar..
@EDIT

ARRUMADO..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)