12.05.2012, 21:50
Ae galera,como que eu faзo pra quando o jogar nao estiver em um carro mandar a mensagem:vc nao esta em um carro ? e quando ele for passageiro mandar:vc nao й o motorista ?
valeu ae.
pawn Код:
//==================================================[MOTOR]======================================================================
if(strcmp("/motor",cmdtext,true,6)==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;
SendClientMessage(playerid, 0xFFFFFFAA, "Motor ligado.");
}
else
{
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, "Motor desligado.");
}
}
return 1;
}
//==================================================[FAROL]===================================================================
if(!strcmp(cmdtext,"/farol",true))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo estб em um carro.");
return true;
}
if(LUZ[carro] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
LUZ[carro] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol desligado!");
}
else if(LUZ[carro] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
LUZ[carro] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Farol ligado!");
}
}
return 1;
}
//==================================================[CAPO]===================================================================
if(!strcmp(cmdtext,"/capo",true))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(CAPO[carro] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_ON, porma, ob);
CAPO[carro] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Capo aberto!");
}
else if(CAPO[carro] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, VEHICLE_PARAMS_OFF, porma, ob);
CAPO[carro] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Capo fechado!");
}
}
return 1;
}
//===============================[PORTA-MALAS]=============================================================================
if(!strcmp(cmdtext,"/porta-malas",true))
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(PORTAMALAS[carro] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob);
PORTAMALAS[carro] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Porta-malas aberto!");
}
else if(PORTAMALAS[carro] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob);
PORTAMALAS[carro] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Porta-malas fechado!");
}
}
return 1;
}