JR_Tapete de Pregos
Certamente procurando, vai encontrar muitos Scripts com o mesmo propósito desse, porém, esse foi feito por mim e está muito mais detalhista, sem bugs e bem configurado, modéstia parte.
Informações:
Certamente procurando, vai encontrar muitos Scripts com o mesmo propósito desse, porém, esse foi feito por mim e está muito mais detalhista, sem bugs e bem configurado, modéstia parte.
Informações:
É um perfeito Script para servidores RolePlay, mas pode ser usado em qualquer GameMode ou servidor. Configurei a posição do tapete no chão pra todos os veículos policiais, pois cada um tem sua altura e como em outros scripts isso não está configurado eu resolvi assim fazer, portanto, todos os veículos policiais foram adaptados e até com veículos não policiais pode-se largar o tapete sem problemas.
Observação:
No princípio configurei só pra soltar de dentro de um veículo, mas agora se pode soltar fora dele também.
Observação:
No princípio configurei só pra soltar de dentro de um veículo, mas agora se pode soltar fora dele também.
O Script:
Você pode usar tanto em um FilterScript como em seu próprio Game Mode, sem problemas:
Você pode usar tanto em um FilterScript como em seu próprio Game Mode, sem problemas:
pawn Código:
//==========================================================// // // // JR_Tapete de Pregos // // Expert Cops v1.0 // // Autor: JR_Junior // // // //==========================================================// #include <a_samp> //Essa Macro não foi criada por mim... Desconheço o autor! #define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3) #define COR_CINZA 0xAFAFAFAA #define COR_BRANCA 0xFFFFFFAA new TapeteCOP[MAX_PLAYERS]; new CrieiTapete[MAX_PLAYERS]; new TempoTapete[MAX_PLAYERS]; new PassandoTapete[MAX_PLAYERS]; new Float:AnguloTapete, Float:TapeteX, Float:TapeteY, Float:TapeteZ; public OnPlayerDisconnect(playerid, reason) { DeletarTapete(playerid); } //Função que identifica/define se o veículo é Policial ou não! stock VeiculosPoliciais(veiculoid) { if(veiculoid == 599 || veiculoid == 528 || veiculoid == 490 || veiculoid == 470 || veiculoid == 432 || veiculoid == 461 || veiculoid == 510 || veiculoid == 521 || veiculoid == 522 || veiculoid == 523) { return 1; } return 0; } //CallBack Chamada para verificar se alguém está passando pelo tapete soltado... forward FurandoPneu(); public FurandoPneu() { for(new i; i < MAX_PLAYERS; i++) { new Dano[4]; if(IsPlayerInAnyVehicle(i)) { new veiculoid = GetVehicleModel(GetPlayerVehicleID(i)); if(!VeiculosPoliciais(veiculoid)) { //Isso impede de furar os pneus de outro carro Policial o do mesmo que soltou os pregos... if(GetPlayerState(i) == PLAYER_STATE_DRIVER) { if(PlayerToPoint(4.0, i,TapeteX,TapeteY,TapeteZ)) { //4.0 Metros, a Distância ideal(Mais realista) entre o veículo e o Tapete, para furar os pneus... GetVehicleDamageStatus(GetPlayerVehicleID(i), Dano[0], Dano[1], Dano[2], Dano[3]); UpdateVehicleDamageStatus(GetPlayerVehicleID(i), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1)); GameTextForPlayer(i,"~y~Pneus ~r~furados",5000,1); return 1; } } } } } return 0; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/pregos", cmdtext, true, 10) == 0) { if(CrieiTapete[playerid] == 1) { SendClientMessage(playerid, COR_CINZA, "||INFO||: Você já colocou um Tapete de Pregos! Aguarde a remoção automática ou use /tpregos!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); } else { GetPlayerPos(playerid,TapeteX,TapeteY,TapeteZ); if(IsPlayerInAnyVehicle(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), AnguloTapete); //Pra cada veículo é uma configuração pra deixar o tapete na posição perfeita sempre... new ModeloCOP = GetVehicleModel(GetPlayerVehicleID(playerid)); if(ModeloCOP == 599 || ModeloCOP == 528 || ModeloCOP == 490) { TapeteCOP[playerid] = CreateObject(2899, TapeteX,TapeteY,TapeteZ-1.0, 0, 0, AnguloTapete+268.0); } else if(ModeloCOP == 470 || ModeloCOP == 432) { TapeteCOP[playerid] = CreateObject(2899, TapeteX,TapeteY,TapeteZ-0.9, 0, 0, AnguloTapete+268.0); } else if(ModeloCOP == 461 || ModeloCOP == 510 || ModeloCOP == 521 || ModeloCOP == 522 || ModeloCOP == 523) { TapeteCOP[playerid] = CreateObject(2899, TapeteX,TapeteY,TapeteZ-0.4, 0, 0, AnguloTapete+268.0); } else { //Essa configuração serve para outros veículos em geral, praticamente todos... TapeteCOP[playerid] = CreateObject(2899, TapeteX,TapeteY,TapeteZ-0.6, 0, 0, AnguloTapete+268.0); } CrieiTapete[playerid] = 1; KillTimer(PassandoTapete[playerid]); PassandoTapete[playerid] = SetTimer("FurandoPneu",199,1); //30000 = 30 segundos que o tapete ficará no chão... Edite com o tempo que desejar! TempoTapete[playerid] = SetTimerEx("DeletarTapete", 30000, 0, "d", playerid); GameTextForPlayer(playerid,"~y~Tapete de pregos ~n~~w~foi colocado",5000,1); SendClientMessage(playerid, COR_BRANCA, "||INFO||: Você colocou um Tapete de Pregos! Ele será removido em 30 segundos ou use /tpregos!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); } else { GetPlayerFacingAngle(playerid, AnguloTapete); CrieiTapete[playerid] = 1; TapeteCOP[playerid] = CreateObject(2899, TapeteX,TapeteY,TapeteZ-0.9, 0, 0, AnguloTapete+268.0); KillTimer(PassandoTapete[playerid]); PassandoTapete[playerid] = SetTimer("FurandoPneu",199,1); //30000 = 30 segundos que o tapete ficará no chão... Edite com o tempo que desejar! TempoTapete[playerid] = SetTimerEx("DeletarTapete", 30000, 0, "d", playerid); GameTextForPlayer(playerid,"~y~Tapete de pregos ~n~~w~foi colocado",5000,1); SendClientMessage(playerid, COR_BRANCA, "||INFO||: Você colocou um Tapete de Pregos! Ele será removido em 30 segundos ou use /tpregos!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); } return 1; } } if (strcmp("/tpregos", cmdtext, true, 10) == 0) { if(CrieiTapete[playerid] == 0) { SendClientMessage(playerid, COR_CINZA, "||INFO||: Você não pôs nenhum Tapete de Pregos!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); return 1; } else { CrieiTapete[playerid] = 0; DestroyObject(TapeteCOP[playerid]); KillTimer(TempoTapete[playerid]); KillTimer(PassandoTapete[playerid]); GameTextForPlayer(playerid,"~y~Tapete de pregos ~n~~r~foi removido",5000,1); //Evita que os pneus sejam furados depois que o Tapete for retirado! TapeteX = 0.000000, TapeteY = 0.000000, TapeteZ = 0.000000; } return 1; } return 0; } forward DeletarTapete(playerid); public DeletarTapete(playerid) { if(CrieiTapete[playerid] == 1) { CrieiTapete[playerid] = 0; DestroyObject(TapeteCOP[playerid]); GameTextForPlayer(playerid,"~y~Tapete de pregos ~n~~r~foi removido",5000,1); KillTimer(PassandoTapete[playerid]); KillTimer(TempoTapete[playerid]); TapeteX = 0.000000, TapeteY = 0.000000, TapeteZ = 0.000000; } return 1; } forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) { if(IsPlayerConnected(playerid)) { new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } return 0; }
Você pode fazer o download do arquivo Pawn desse Script, também:
1 comentários:
qual o comando ?
Postar um comentário