28.08.2015, 22:38
galera toda vez q eu spawno no servidor meu servidor fecha sozinho e tipo eu coloquei este seguinte codigo nela
No Topo do GM:
No PublicOnGameModInt
comandos
public keys
No Topo do GM:
PHP код:
new motor[MAX_PLAYERS]
PHP код:
ManualVehicleEngineAndLights();
PHP код:
CMD:motoron(playerid)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
motor[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
}
}
return 1;
}
CMD:motoroff(playerid)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
motor[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
}
}
return 1;
}
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == KEY_YES))
{
cmd_inv(playerid);
}
if((newkeys == KEY_YES) && (IsPlayerInAnyVehicle(playerid)))
{
cmd_motoron(playerid);
SendClientMessage(playerid, 0xFA879BC8, "*%s turns on the vehicle's engine");
PlayerPlaySound(playerid, 1054 , 0.0, 0.0, 10.0);
}
else
{
cmd_motoroff(playerid);
SendClientMessage(playerid, 0xFA879BC8, "*%s turns off the vehicle's engine");
PlayerPlaySound(playerid, 1054 , 0.0, 0.0, 10.0);
}
return 1;
}