27.07.2013, 23:46
Quote:
Exemplo:
pawn Код:
|
PHP код:
if (strcmp("/motor", cmdtext, true, 10) == 0)
{
new State;
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
MSGPLAYER(playerid,COLOR_GREY," Vocк nгo й o motorista/piloto do veнculo");
return 1;
}
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, {FFFFFF}Digite /motor para desliga-lo");
}
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;
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado, {FFFFFF}Digite /motor para liga-lo");
}
}
}
return 1;
}
PHP код:
if(motor[i] == 1)
{
format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Ligado");
motor[playerid] = 1; // ligado
}
else if(motor[i] == 0)
{
format(velopet5,sizeof(velopet5),"~r~~h~~h~~h~~h~Motor: ~w~Desligado");
motor[playerid] = 0; // desligado
}
TextDrawSetString(MotorOnOFF[i], velopet5);