SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/04/2009, 11:37 AM   #1
stevestelford
Little Clucker
 
Join Date: Oct 2008
Posts: 38
Reputation: 0
Default Player Protection. Like Protection when entering checkpoint. and interior.

Heya Guys i want it so that players have protection only in 24/7 shops and Gun Shops. I have set
AllowInteriorWeapons(1); which allows but i want players to be protected too.

Also i wanted to know how to set protection when a player enters a checkpoint.

Cheers Guys.
stevestelford is offline   Reply With Quote
Old 07/04/2009, 01:02 PM   #2
miokie
High-roller
 
miokie's Avatar
 
Join Date: Jan 2007
Location: Bedfordshire, England
Posts: 1,148
Reputation: 13
Default Re: Player Protection. Like Protection when entering checkpoint. and interior.

Use a timer that resets your health to 100 or something every 500ms or so and use a area checker...
__________________
miokie is offline   Reply With Quote
Old 08/06/2012, 12:03 AM   #3
DaRealShazz
Big Clucker
 
DaRealShazz's Avatar
 
Join Date: Jan 2012
Posts: 173
Reputation: 55
Default Re: Player Protection. Like Protection when entering checkpoint. and interior.

Don't use above method.

pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
   
    if(GetPlayerInterior(playerid) != 0)
    {
        new Float:health;
        GetPlayerHealth(playerid,health);
        SetPlayerHealth(playerid, health+amount);
    }
    else if(IsPlayerInCheckpoint(playerid))
    {
        new Float:health;
        GetPlayerHealth(playerid,health);
        SetPlayerHealth(playerid, health+amount);
    }
    return 1;
}
DaRealShazz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Airbrake protection andrewp Help Archive 5 17/03/2010 01:55 AM
Need protection against ... SpUnKyMe Server Support 0 03/09/2009 02:37 PM
i need TAG protection! arsham Help Archive 4 30/07/2009 12:18 AM
How do i add Tag protection!?!??!?!?! arsham Help Archive 0 29/07/2009 03:22 AM


All times are GMT. The time now is 10:33 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.