Minefield
#1

Im new to scripting, I created a map for an FBI faction and I want to make it so that only members of the faction can enter without being blown up. Any other player (not admins) must be destroyed. Like a minefield. Help!
Reply
#2

I'm new to scripting also, but I will give this question a try. Try somthing like this:


pawn Код:
if(IsPlayerInRangeOfPoint(playerid, x,y,z)
{
if(IsAFBI(playerid) /*(use whatever you use in your GM to specify their job)*/ return 1;
new playerid;
new Float:boomx, Float:boomy, Float:boomz;
GetPlayerPos(playerid,boomx, boomy, boomz);
CreateExplosion(boomx, boomy , boomz, 7, 1);
}
Reply
#3

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
I'm new to scripting also, but I will give this question a try. Try somthing like this:


pawn Код:
if(IsPlayerInRangeOfPoint(playerid, x,y,z)
{
if(IsAFBI(playerid) /*(use whatever you use in your GM to specify their job)*/ return 1;
new playerid;
new Float:boomx, Float:boomy, Float:boomz;
GetPlayerPos(playerid,boomx, boomy, boomz);
CreateExplosion(boomx, boomy , boomz, 7, 1);
}
Let me help you a bit..

pawn Код:
if( IsPlayerInRangeOfPoint( playerid, radius, x, y, z ) )
{
    if( IsAFBI( playerid ) )
        return false; // Allow them to continue on their merry way.
       
    new
        Float: MyPos [ 3 ];
       
    GetPlayerPos( playerid, MyPos [ 0 ], MyPos [ 1 ], MyPos [ 2 ] );
    // Gets their position and stores the X value as MyPos [ 0 ],
     // Y value as MyPos [ 1 ], and Z value as MyPos [ 2 ].
     
    CreateExplosion( MyPos [ 0 ], MyPos [ 1 ], MyPos [ 2 ], 7, 1 );
    // Creates an explosion at their position.
   
    SetPlayerHealth( playerid, 0.0 );
    // Since one explosion isn't going to kill them - set their health.
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)