Help with Spawnkilling
#10

Take my code.
PHP код:
public OnPlayerDeath(playerid,killerid,reason

    if(
killerid != INVALID_PLAYER_ID
    { 
        if(
IsPlayerInArea(playerid,XX,XX,XX,XX)) 
        { 
            
SetPlayerHealth(killerid,0.0); 
        } 
    } 
    return 
1

/* Notes: 
- The XX,XX,XX,XX are the coordinates 
(1. XX => MinX) 
(2. XX => MinY) 
(3. XX => MaxX) 
(4. XX => MaxY) 
- Use this function at the end of this codes 
*/ 
//This is the function which you need: 
IsPlayerInArea(playeridFloat:MinXFloat:MinYFloat:MaxXFloat:MaxY

    new 
Float:XFloat:YFloat:Z
    
GetPlayerPos(playeridXYZ); 
    if(
>= MinX && <= MaxX && >= MinY && <= MaxY) { 
        return 
1
    } 
    return 
0

IsPlayerInArea is the function to check if the players are in the area of the spawn.
Try this.
Reply


Messages In This Thread
Help with Spawnkilling - by D1am0nd - 25.10.2015, 18:40
Re : Help with Spawnkilling - by StreetRP - 25.10.2015, 19:11
Re: Help with Spawnkilling - by D1am0nd - 26.10.2015, 11:44
Re: Help with Spawnkilling - by Mencent - 26.10.2015, 11:52
Re: Help with Spawnkilling - by sanamalik400 - 26.10.2015, 17:17
Re: Help with Spawnkilling - by LovelySoomro - 26.10.2015, 17:57
Re : Help with Spawnkilling - by StreetRP - 26.10.2015, 19:14
Re: Help with Spawnkilling - by Mencent - 27.10.2015, 09:25
Re: Help with Spawnkilling - by D1am0nd - 27.10.2015, 12:06
Re: Help with Spawnkilling - by Mencent - 27.10.2015, 12:11

Forum Jump:


Users browsing this thread: 1 Guest(s)