07.11.2012, 21:56
Eae pessoal, algum de vocкs tem algum sistema de tipo o player entra no carro ai o carro nao anda ai dps q ele aperta ctrl ou shift o carro liga e ele pode andar...Ja usei o search e achei mais nao funfo nenhum
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new mot, lu, alar, por, cap, porma, ob;
{
GetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, porma, ob);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == 4) && (IsPlayerInAnyVehicle(playerid)))
{
OnPlayerCommandText(playerid, "/motor");
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
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;
}
else 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;
}
}
}