01.05.2013, 15:18
bom galera,sу hб um problema...essa include contem um
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
e o meu sv tambйm...ou seja vai dar o erro do macro/symbol que vcs devem conhecer..o problema й que eu nгo consigo integrar o public da include no meu gm,da erro a toda hora
Public do GM:
public da inclde:
oque eu faзo?
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
e o meu sv tambйm...ou seja vai dar o erro do macro/symbol que vcs devem conhecer..o problema й que eu nгo consigo integrar o public da include no meu gm,da erro a toda hora
Public do GM:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerNPC(playerid)) return 1;
xacalaca[playerid] ++;
SetTimerEx("desxacalaca", 1000,false,"i",playerid);
PlayerInactivity[playerid] = 0;
if(newstate == PLAYER_STATE_ONFOOT)
{
SetCameraBehindPlayer(playerid);
if(PlayerToPoint(11, playerid, 616.7898,-74.8150,997.8890))
{
PutPlayerInVehicle(playerid, gLastCar[playerid], 0);
Controle(playerid, 0);
}
if(TransportDuty[playerid] > 0)
{
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(gstring, sizeof(gstring), "* Estб fora de serviзo, ganhou R$%d.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
GivePlayerMoneyEx(playerid, TransportMoney[playerid]);
ConsumingMoney[playerid] = 1;
TransportValue[playerid] = 0;
TransportMoney[playerid] = 0;
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(gstring, sizeof(gstring), "~w~Custo da corrida~n~~r~R$%d",TransportCost[playerid]);
GameTextForPlayer(playerid, gstring, 5000, 1);
format(gstring, sizeof(gstring), "~w~Passageiro saiu do taxi~n~~g~ganhou R$%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], gstring, 5000, 1);
GivePlayerMoneyEx(playerid, -TransportCost[playerid]);
TransportCost[playerid] = 0;
TransportTime[playerid] = 0;
TransportDriver[playerid] = 999;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
}
if (newstate == 2 || newstate == 3)
{
if(GetPlayerVehicleID(playerid) == 24)
{
if(PlayerInfo[playerid][pLider] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Vocк nгo й o delegado de Los Santos!");
}
}
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI, BUSSES, BOTS
{
new name[MAX_PLAYER_NAME];
new arma = GetPlayerWeapon(playerid);
GetPlayerName(playerid, name, sizeof(name));
if(arma == 24 || arma == 25)
{
SetPlayerArmedWeapon(playerid, 0);
SendClientMessage(playerid, COLOR_GRAD1, "Proibido entrar de passageiro com esta arma, ela foi retirada de sua mгo!");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
{
if(GetPlayerMoney(playerid) < TransportValue[i])
{
format(gstring, sizeof(gstring), "* Vocк precisa de R$%d para entrar.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
RemovePlayerFromVehicleEx(playerid);
}
else
{
if(TransportDuty[i] == 1)
{
format(gstring, sizeof(gstring), "* Pagou R$%d para o taxista.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
format(gstring, sizeof(gstring), "* Passageiro %s entrou no Taxi.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, gstring);
TransportTime[i] = 1;
TransportTime[playerid] = 1;
TransportCost[playerid] = TransportValue[i];
TransportCost[i] = TransportValue[i];
TransportDriver[playerid] = i;
}
else if(TransportDuty[i] == 2)
{
format(gstring, sizeof(gstring), "* Pagou R$%d para o Motorista De Onibus.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, gstring);
format(gstring, sizeof(gstring), "* Passageiro %s entrou no Onibus.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, gstring);
}
GivePlayerMoneyEx(playerid, - TransportValue[i]);
TransportMoney[i] += TransportValue[i];
}
}
}
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк pode ver alguns comandos do veiculo digitando /ajudaveh");
SendClientMessage(playerid, COLOR_YELLOW2, "[Heroes] Aperte a letra Y para ativar a cвmera em 1Є pessoa.");
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new HouseCar = PlayerInfo[playerid][pPHousekey]+totalveiculos;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
new carid=GetVehicleModel(newcar);
if(carid == 0 || carid == 0 || carid == 0) { }
else
{
if(IsAAztecaCar(newcar))
{
if(!IsAAzteca(playerid) && !IsAAztecaSF(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й dos Varriors Los Aztecas");
RemovePlayerFromVehicleEx(playerid);
}
}
//=============[ COPS ] =================
else if(IsAPMSFCar(newcar) || IsAROTAsCar(newcar) || IsAPFCar(newcar) || IsAExCar(newcar))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Policial");
RemovePlayerFromVehicleEx(playerid);
}
}
//==========================================
else if(IsAOniCar(newcar))
{
if(!IsAOni(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um motorista de Onibus");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAPRCar(newcar))
{
if(!IsAPR(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Hero!");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAMecCar(newcar))
{
if(PlayerInfo[playerid][pEmprego] != 5)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Mecвnico");
RemovePlayerFromVehicleEx(playerid);
}
}
//========================================
else if(IsAPCCCar(newcar))
{
if(!IsAPCCSF(playerid) && !IsAPCC(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um PCC");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsABallasCar(newcar))
{
if(!IsABallasSF(playerid) && !IsABallas(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Ballas");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAVagosCar(newcar))
{
if(!IsAVagosSF(playerid) && !IsAVagos(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Los Santos Vagos");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAGrooveCar(newcar))
{
if(!IsAGroove(playerid) && !IsAGrooveSF(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Groove Street");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAnAmbulanceCar(newcar))
{
if(!IsAMedicosSF(playerid) && !IsAMedicos(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Medico");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAComandoVermelhoCar(newcar))
{
if(!IsASonsofAnarchy(playerid) && !IsAComandoVermelho(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й do Comando Vermelho");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsACaminhoneiroCar(newcar))
{
if(!IsACaminhoneiro(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Caminhoneiro");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAJornalCar(newcar))
{
if(!IsAJornal(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Repуrter");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsASecretariaCar(newcar))
{
if(!IsASecretaria(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й do B.O.P.E!");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsADriftersCar(newcar))
{
if(!IsADrifters(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Drifter");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(Issemtaxi(newcar))
{
if(TaxiDrivers == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Veiculo disponivel apenas quando nao ha taxistas trabalhando! utilize /servico taxi!");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsATaxiCar(newcar))
{
if(!IsATaxi(playerid) && !IsATaxiSF(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Taxista");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAAlCar(newcar))
{
if(!IsAAl(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um FARC");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAGICar(newcar))
{
if(!IsAGI(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Guerrilheiro Israelita");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAExCar(newcar))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й do Exйrcito");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsACopCar(newcar))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Policial");
RemovePlayerFromVehicleEx(playerid);
}
}
else if(IsAHitCar(newcar))
{
if(!IsAHit(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й um Hitman");
RemovePlayerFromVehicleEx(playerid);
}
}
//====================================================================
else if(IsAHelperCar(newcar))
{
if(PlayerInfo[playerid][pHelper] == 0)
{
SendClientMessage(playerid, COR_HELPER, " Vocк nгo й um Helper");
RemovePlayerFromVehicleEx(playerid);
return true;
}
if(helpertrampando[playerid] == 0)
{
SendClientMessage(playerid, COR_HELPER, " Vocк nгo esta em Modo ajuda!");
RemovePlayerFromVehicleEx(playerid);
return true;
}
return 1;
}
//==============================================================================
else if(IsAGOVCar(newcar))
{
if(!IsAGOV(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo й da Prefeitura");
RemovePlayerFromVehicleEx(playerid);
}
}
}
if(IsAPlane(newcar))
{
if(PlayerInfo[playerid][pFlyLic] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк ainda nгo tem licenзa para Voar! Compre uma na Prefeitura");
SetPlayerCriminal(playerid,255,"Voando Sem Licenзa");
}
}
else
{
if(PlayerInfo[playerid][pCarLic] < 1)
{
if(PlayerDrunk[playerid] >= 1)
{
SetPlayerCriminal(playerid,255, "Dirigindo Embreagado");
}
if(IsABikeCar(newcar)) { }
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк ainda nгo tem licenзa para dirigir carro! Compre uma na Prefeitura");
SetPlayerCriminal(playerid,255,"Dirigindo sem Carteira");
}
}
else if(PlayerDrunk[playerid] >= 1)
{
SetPlayerCriminal(playerid,255, "Dirigindo Embreagado");
}
}
/*if((newcar >= 322 && newcar <=367) || (newcar >= 402 && newcar <=408))
{
if (HireCar[playerid] != newcar)
{
new Aluguelbox[256];
format(Aluguelbox, sizeof(Aluguelbox),"Este Veiculo pode ser alugado Preзo:R$%d", SBizzInfo[1][sbEntranceCost]);
Controle(playerid, 0);
ShowPlayerDialog(playerid, DIALOG_ALUGAR, DIALOG_STYLE_MSGBOX, "Alugar o Veiculo", Aluguelbox, "Alugar", "sair");
}
}
if((newcar >= 368 && newcar <= 370))
{
if (HireCar[playerid] != newcar)
{
new Aluguelbox[256];
format(Aluguelbox, sizeof(Aluguelbox),"Este Helicуptero pode ser alugado Preзo:R$%d", SBizzInfo[19][sbEntranceCost]);
Controle(playerid, 0);
ShowPlayerDialog(playerid, DIALOG_ALUGAR2, DIALOG_STYLE_MSGBOX, "Aluguel de Helicopteros", Aluguelbox, "Alugar", "Sair");
}
}*/
if(oldcar != 301)
{
if((HouseCar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != HouseCar))
{
if(gLastDriver[oldcar] == playerid && oldcar != newcar)
{
gLastDriver[oldcar] = 300;
VTrancado[oldcar] = 0;
UnLockCar(oldcar);
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}
if(newstate == PLAYER_STATE_SPAWNED && logouagora[playerid] ==0 )
{
if(sincronizando[playerid] == 1)
{
return true;
}
new Float: lwx, Float:lwy, Float:lwz;
GetPlayerPos(playerid, lwx, lwy, lwz);
if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
{
if(sincronizando[playerid] == 1)
{
return true;
}
SetPlayerSpawn(playerid);
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
gPlayerSpawned[playerid] = 1;
SafeTime[playerid] = 60;
}
return true;
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_FIRE)) RL_Shooting[playerid]=true;
else if(RELEASED(KEY_FIRE))
{
RL_Shooting[playerid]=false;
RL_Released[playerid]=GetTickCount();
}
return (RL_OPKSC)?CallLocalFunction("RL_OnPlayerKeyStateChange","iii",playerid,newkeys,oldkeys):1;
}
#if defined _ALS_OnPlayerKeyStateChange
#undef OnPlayerKeyStateChange
#else
#define _ALS_OnPlayerKeyStateChange
#endif
#define OnPlayerKeyStateChange RL_OnPlayerKeyStateChange
forward RL_OnPlayerKeyStateChange(playerid,newkeys,oldkeys);
// OnPlayerStateChange
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_WASTED)
{
if(RL_UpdatedHealth[playerid])
RL_UpdatedHealth[playerid]=false;
else
{
new
Float:RL_PlayerPos[3],
Float:RL_Distance,
Float:RL_CameraPos[3],
Float:RL_CameraVectors[3],
RL_Tick,
Float:RL_HP,
Float:RL_Armour
;
GetPlayerHealth(playerid,RL_HP);
GetPlayerArmour(playerid,RL_Armour);
RL_Tick = (GetTickCount()-1000);
GetPlayerPos(playerid, RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]);
foreach(Player,i)
{
if(RL_Shooting[i] || RL_Tick < RL_Released[i])
{
if(i != playerid)
{
GetPlayerCameraWeaponVector(i, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2]);
GetPlayerCameraPos(i, RL_CameraPos[0], RL_CameraPos[1], RL_CameraPos[2]);
if(IsPlayerInRangeOfPoint(i,200.0,RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]))
{
GetDistanceFromPointToLine(RL_Distance, RL_CameraVectors[0], RL_CameraVectors[1], RL_CameraVectors[2], RL_CameraPos[0], RL_CameraPos[1], RL_CameraPos[2], RL_PlayerPos[0], RL_PlayerPos[1], RL_PlayerPos[2]);
if(RL_Distance < 2.5)
{
CallLocalFunction("OnPlayerShootPlayer","iiff",i,playerid,(RL_phealth[playerid]-RL_HP),(RL_parmour[playerid]-RL_Armour));
break;
}
}
}
}
}
}
}
RL_Shooting[playerid]=false;
RL_Released[playerid]=GetTickCount();
return (RL_OPSC)?CallLocalFunction("RL_OnPlayerStateChange","iii",playerid,newstate,oldstate):1;