Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Começo do GM
- forward PlayerToPoint( Float:radi, playerid, Float:x, Float:y, Float:z) ;
- new Veiculo,Comeco,TmrVeiculo;
- new PlayerAperto[MAX_PLAYERS];
- forward Fogo();
- //OnGameModeInit
- Veiculo=CreateVehicle(411,-1558.9570,1184.3970,6.9030,149.9782,0,0,5000000);
- //OnPlayerKeyStateChange
- if(newkeys==KEY_FIRE)
- {
- if(PlayerToPoint(10.0, playerid,-1558.9570,1184.3970,6.9030))
- {
- if(GetPlayerWeapon(playerid) == 42 )
- {
- if(GetPlayerSkin(playerid) == 278)
- {
- PlayerAperto[playerid]++;
- if(PlayerAperto[playerid] >= 5)
- {
- PlayerAperto[playerid]=0;
- Comeco=2;
- }
- }
- }
- }
- }
- //OnPlayerCommandText
- if(!strcmp(cmdtext, "/incendio", true))
- {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid,0xFFFF00AA,"Você criou um Incêndio");
- Comeco=0,TmrVeiculo=0,Fogo();
- for(new i;i<50;i++) if(GetPlayerSkin(playerid) == 278)
- {
- SendClientMessage(i,0xFF0000AA,"Um incêndio se inciou, vá até o checkpoint em seu mapa para apagá-lo! Vocês tem 10 minutos para chegar!");
- SetPlayerRaceCheckpoint(i,1,-1558.9570,1184.3970,6.9030,0.0,0.0,0.0,10);
- }
- }
- return 1;
- }
- //Final do Game Mode
- public Fogo(){
- TmrVeiculo++;
- if(TmrVeiculo>=3){
- switch(Comeco){
- case 0: SetVehicleHealth(Veiculo,20.0),Comeco=1,TmrVeiculo=0;
- case 1: SetVehicleHealth(Veiculo,1000.0),Comeco=0,TmrVeiculo=2;
- case 2: SetVehicleHealth(Veiculo,1000.0),Comeco=3;
- }
- }
- SetTimer("Fogo",1000,false);
- return 0;
- }
- 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) ;
- //printf( "DEBUG: X:%f Y:%f Z:%f",posx,posy,posz) ;
- if ( ( ( tempposx < radi) && ( tempposx > -radi) ) && ( ( tempposy < radi) && ( tempposy > -radi) ) && ( ( tempposz < radi) && ( tempposz > -radi) ) )
- {
- return 1 ;
- }
- }
- return 0 ;
- }
- // By [FeK]Knife
- // [FeK]Squad
Advertisement
Add Comment
Please, Sign In to add comment