02.06.2014, 01:22
tipo nomeu server puis isso :
no public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
e no public OnPlayerCommandText(playerid, cmdtext[])
E terceiro no public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
Mais quendo entro no meu server eu quero que os carros estao desligados mais tipo entro num carro e ele ja ta ligado e aperto y pra ligar ae fala veiculo ligado e aperto de novo ae desliga
mais queria q todos carros do meu serve ficase desligado e apertava y ligava o veiculo
tem um algun sistema q o carro fica desligado ?
no public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[256];
new McCarro[128];// Pus isso
new engine, lights, alarm, doors, bonnet, boot, objective;// Pus isso
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s acaba de Entrar em um Veiculo ", sendername);
format(McCarro, sizeof (McCarro), "Ligar ou desligar o Motor do veiculo precione [Y] e a Luz [N].");// Pus isso
SendClientMessage(playerid, 0xFFFFFFFF, McCarro);// Pus isso
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
if(GetVehicleModel(vehicleid) == 462 || GetVehicleModel(vehicleid) == 463 || GetVehicleModel(vehicleid) == 471 || GetVehicleModel(vehicleid) == 521 || GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 523 || GetVehicleModel(vehicleid) == 581 || GetVehicleModel(vehicleid) == 586) // 411 is the infernus model
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);// Pus isso
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);// Pus isso
}
return 1;
}
PHP код:
if (strcmp("/farol", cmdtext, true, 10) == 0)
{
new vehveh = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
{
if(GetPVarInt(playerid, "lights") == 0)
{
GetVehicleParamsEx(vehveh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehveh, engine,VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Farol do veiculo Ligado.");
SetPVarInt(playerid, "lights", 1);
return 1;
}
else if(GetPVarInt(playerid, "lights") == 1)
{
GetVehicleParamsEx(vehveh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehveh, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Farol do veiculo Desligado.");
SetPVarInt(playerid, "lights", 0);
return 1;
}
}
}
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
new vehveh = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
{
if(GetPVarInt(playerid, "engine") == 0)
{
GetVehicleParamsEx(vehveh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehveh, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Motor do veiculo Ligado.");
SetPVarInt(playerid, "engine", 1);
return 1;
}
else if(GetPVarInt(playerid, "engine") == 1)
{
GetVehicleParamsEx(vehveh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehveh, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, -1, "Motor do veiculo Desligado.");
SetPVarInt(playerid, "engine", 0);
return 1;
}
}
}
PHP код:
if((newkeys == 65536) && (IsPlayerInAnyVehicle(playerid)))
{
OnPlayerCommandText(playerid, "/motor");
}
if((newkeys == 131072) && (IsPlayerInAnyVehicle(playerid)))
{
OnPlayerCommandText(playerid, "/farol");
}
mais queria q todos carros do meu serve ficase desligado e apertava y ligava o veiculo
tem um algun sistema q o carro fica desligado ?