Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ed
- // public usada quando jogadores matam uns aos outros.
- public OnPlayerDeath(playerid, killerid, reason)
- /*
- playerid = Acusado
- killerid = Vítima
- */
- // Obtém o ID do veiculo que o acusado ocupa.
- GetPlayerVehicleID(playerid)
- //Aqui será definido o ID das aeronaves.
- IsAAviao(carid)
- IsAHelicoptero(carid)
- // Nossa string definida com o valor dela.
- new string[256]
- // Nossa new definida, irá definir o nome do acusado e da vítima.
- new acusado[MAX_PLAYER_NAME], vitima[MAX_PLAYER_NAME];
- // Obtém o nome do acusado e da vítima.
- GetPlayerName(killerid, acusado, MAX_PLAYER_NAME);
- GetPlayerName(playerid, vitima, MAX_PLAYER_NAME);
- // Verifica se o assassino esta em um veículo.
- GetPlayerState(killerid) == PLAYER_STATE_DRIVER
- // Manda a mensagem para todos online no servidor e assim desmascarando o acusado.
- format(string, sizeof(string), "[Anti drive-by]: %s cometeu drive-by em %s e será punido por um admin.", acusado, vitima);
- SendClientMessageToAll(0xE60000FF, string);
- // Para que os jogadores em aeronaves não sejam acusados, adicione as seguintes stock em seu gamemode!
- stock IsAHelicoptero(carid)
- {
- new modelid = GetVehicleModel(carid);
- if(modelid == 563 || modelid == 548 || modelid == 497 || modelid == 488 || modelid == 487)
- {
- return 1;
- }
- if(modelid == 425 || modelid == 417 || modelid == 447 || modelid == 469)
- {
- return 1;
- }
- return 0;
- }
- stock IsAAviao(carid)
- {
- new modelid = GetVehicleModel(carid);
- if(modelid == 460 || modelid == 476 || modelid == 511 || modelid == 512)
- {
- return 1;
- }
- if(modelid == 513 || modelid == 519 || modelid == 520 || modelid == 553)
- {
- return 1;
- }
- if(modelid == 577 || modelid == 592 || modelid == 593)
- {
- return 1;
- }
- return 0;
- }
- // Nosso anti-drive by foi feito com sucesso, adicione em sua OnPlayerDeath, e adicione também as duas seguintes stock, IsAAviao e IsAHelicoptero em seu gamemode.
- public OnPlayerDeath(playerid, killerid, reason){
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER){
- if(IsAHelicoptero(GetPlayerVehicleID(killerid)) || IsAAviao(GetPlayerVehicleID(killerid))) return 1;
- new string[256], acusado[MAX_PLAYER_NAME], vitima[MAX_PLAYER_NAME];
- GetPlayerName(killerid, acusado, MAX_PLAYER_NAME);
- GetPlayerName(playerid, vitima, MAX_PLAYER_NAME);
- format(string, sizeof(string), "[Anti drive-by]: %s cometeu drive-by em %s e será punido por um admin.", acusado, vitima);
- SendClientMessageToAll(0xE60000FF, string);
- }
- return 1;
- }
- /*
- Créditos: Márcio Siqueira///Gáin e a www.HomeHots.com.br
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement