Why it doesn't work ?
#1

Why there is no explosions ?

At least, the script works fine !

PHP код:
PUBLIC:Explosions()
{
    foreach(new 
i:Player)
    {
      if(
PlayerToPoint(10.0i, -1479.7295,971.4417,10.7425))
        {
            if(
CentraleBlown == 0)
            {
                if(
gTeam[i] != TEAM_COP || gTeam[i] != TEAM_ARMY || gTeam[i] != TEAM_CIA || gTeam[i] != TEAM_LEADERRAID || gTeam[i] != TEAM_COLEADERRAID || gTeam[i] != TEAM_RAID || gTeam[i] != TEAM_LEADERSWAT || gTeam[i] != TEAM_COLEADERSWAT || gTeam[i] != TEAM_SWAT)
                {
                    
SendClientMessage(i,COLOR_RED,"Vous devez exploser la centrale йlйctrique afin d'йviter les explosions.");
                    new 
Float:xFloat:yFloat:z;
                    
GetPlayerPos(ixyz);
                    
CreateExplosion(x,y,z910.0);
                }
               }
        } 
:/
Reply
#2

I have no idea what you're trying to do, but I'm 90% sure that your if-statement is wrong. I think you mean to check if the player is: not in TEAM_COP AND not in TEAM_ARMY AND not in TEAM_CIA AND ...
Reply
#3

What I'm trying to do is simple,

If a criminal get into those coordinates, he get exploded

But, there is no explosion ..

I chose the best loop, "foreach"..

Thanks.
Reply
#4

I believe PlayerToPoint is deprecated, use IsPlayerInRangeOfPoint.

What I like to do is do a "SendClientMessage" saying "Debug stage: #" so that you know where it's breaking.
Reply
#5

What isn't working, the explosion only?
Reply
#6

pawn Код:
PUBLIC:Explosions()
{
    foreach(new i:Player)
    {
        if(IsPlayerInRangeOfPoint(i, 10.0, -1479.7295,971.4417,10.7425))
        {
            if(CentraleBlown == 0)
            {
                if(gTeam[i] != TEAM_COP && gTeam[i] != TEAM_ARMY && gTeam[i] != TEAM_CIA && gTeam[i] != TEAM_LEADERRAID && gTeam[i] != TEAM_COLEADERRAID && gTeam[i] != TEAM_RAID && gTeam[i] != TEAM_LEADERSWAT && gTeam[i] != TEAM_COLEADERSWAT && gTeam[i] != TEAM_SWAT)
                {
                    SendClientMessage(i,COLOR_RED,"Vous devez exploser la centrale йlйctrique afin d'йviter les explosions.");
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(i, x, y, z);
                    CreateExplosion(x,y,z, 9, 10.0);
                }
            }
        }  
    }
}
Instead of:
pawn Код:
if(gTeam[i] != TEAM_COP && gTeam[i] != TEAM_ARMY && gTeam[i] != TEAM_CIA && gTeam[i] != TEAM_LEADERRAID && gTeam[i] != TEAM_COLEADERRAID && gTeam[i] != TEAM_RAID && gTeam[i] != TEAM_LEADERSWAT && gTeam[i] != TEAM_COLEADERSWAT && gTeam[i] != TEAM_SWAT)
You can create a class for criminal and do:
pawn Код:
if(gTeam[i] == TEAM_CRIMINAL)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)