17.09.2011, 17:57
O seguinte codigo nгo ta funcionando, simplismente nao liga o carro e nem envia a mensagem... A tecla que devo apertar й ALT, se alguem puder me ajudar, ficaria grato ^^
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == KEY_WALK))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
new carid = GetPlayerVehicleID(playerid);
new string[256];
new membro, lider;
lider = PlayerInfo[playerid][pLeader];
membro = PlayerInfo[playerid][pMember];
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(carid == CopCars[0]||carid == CopCars[1]||carid == CopCars[2]||carid == CopCars[3]||carid == CopCars[4]||carid == CopCars[5]||carid == CopCars[6]||carid == CopCars[7]||carid == CopCars[8]||carid == CopCars[9]||carid == CopCars[10]||
carid == CopCars[11]||carid == CopCars[12]||carid == CopCars[13]||carid == CopCars[14]||carid == CopCars[15]||carid == CopCars[16]||carid == CopCars[17]||carid == CopCars[18]||carid == CopCars[19]||carid == CopCars[20]||
carid == CopCars[21]||carid == CopCars[22]||carid == CopCars[23]||carid == CopCars[24]||carid == CopCars[25]||carid == CopCars[26]||carid == CopCars[27]||carid == CopCars[28])
{
if(vehEngine[carro] == 0)
{
if(lider == 1 || membro == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
format(string, 256, "%s, ligou o veнculo.",pNome(playerid));
ProxDetector(20.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
vehEngine[carro] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1,"Vocк nгo tem as chaves, para ligar esse veiculo.");
return 1;
}
}
if(vehEngine[carro] == 1)
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
format(string, 256, "%s, desligou o veнculo.",pNome(playerid));
ProxDetector(20.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
vehEngine[carro] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1,"Vocк nгo tem as chaves, para desligar esse veiculo.");
return 1;
}
}
}
}
}
return 1;
}
return 1;
}