[GameMode] [0.3.7] Police vs Terrorist
#1







Hey,
So well this is a very simpel Gamemode good for learning.
There are 2 Teams: Police and Terrorist.
For each kill someone makes, the team in which he is inside gets Points.
The aim is to reach the most points.

Downloads
Full Package:
V. 1.1 http://www.mediafire.com/download/2g...rh/Package.zip
Reply
#2

Good job, but it is better to add:

* Add Description gamemode.
* Remove duplicate name when connecting
* Add keep line to prevent the escape of the arena

PS: Successful design! complete your beautiful theme
Reply
#3

Good job.
Reply
#4

Quote:
Originally Posted by Logofero
View Post
Good job, but it is better to add:

* Add Description gamemode.
* Remove duplicate name when connecting
* Add keep line to prevent the escape of the arena

PS: Successful design! complete your beautiful theme
Thank you for your feedback, will add your suggestions to the update notes.

Quote:
Originally Posted by RedLabel
View Post
Good job.
Thank's
Reply
#5

Quote:
Originally Posted by MrGtasagamer
View Post
Thank you for your feedback, will add your suggestions to the update notes.
My example code for keep zone:
PHP Code:
new keepzone[4];
/*
 * native IsPlayerInArea3D(playerid, Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz);
 */
stock IsPlayerInArea3D(playerid, Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz) {
    new
        
Float: x,
        
Float: y,
        
Float: z
    
;
    if (!
GetPlayerPos(playerid, x, y, z)) return false;
    if (
x >= minx && x <= maxx && y >= miny && y <= maxy && z >= minz && z <= maxz) {
        return 
true;
    }
    return 
false;
}
/*
 * native CreateCutZone(gangzone[4], Float:minx, Float:miny, Float:maxx, Float:maxy);
 */
 // Map Andreas
 // -------------------------------
 //         +---------B maxx maxy
 //         | CutZone |
 //         A---------+
 // minx miny
 // -------------------------------
stock CreateCutZone(gangzone[4], Float:minx, Float:miny, Float:maxx, Float:maxy) 
{
    
gangzone[0] = GangZoneCreate(minx, maxy, maxx, 3000.0);         // top
    
gangzone[1] = GangZoneCreate(-3000.0, -3000.0, minx, 3000.0);   // left
    
gangzone[2] = GangZoneCreate(minx, -3000.0, maxx, miny);        // bottom
    
gangzone[3] = GangZoneCreate(maxx, -3000.0, 3000.0, 3000.0);    // right
}
/*
 * native ShowPlayerCutZone(playerid, gangzone[4], color);
 */
stock ShowPlayerCutZone(playerid, gangzone[4], color) {
    for (new 
i; i < 4; i++) {
        
GangZoneShowForPlayer(playerid, gangzone[i], color);
    }
}
/*
 * native HidePlayerCutZone(playerid, gangzone[4]);
 */
stock HidePlayerCutZone(playerid, gangzone[4]) {
    for (new 
i; i < 4; i++) {
        
GangZoneHideForPlayer(playerid, gangzone[i]);
    }
}
/*
 * native ShowAllCutZone(gangzone[4], color);
 */
stock ShowAllCutZone(gangzone[4], color) {
    for (new 
i; i < 4; i++) {
        
GangZoneShowForAll(gangzone[i], color);
    }
}
/*
 * native HideAllCutZone(gangzone[4]);
 */
stock HideAllCutZone(gangzone[4]) {
    for (new 
i; i < 4; i++) {
        
GangZoneHideForAll(gangzone[i]);
    }
}
/*
 * native DestroyCutZone(gangzone[4]);
 */
stock DestroyCutZone(gangzone[4]) {
    for (new 
i; i < 4; i++) {
        
GangZoneHideForAll(gangzone[i]);
        
GangZoneDestroy(gangzone[i]);
    }
}
/*
 * native SetCutZoneFlashForPlayer(playerid, gangzone[4], color);
 */
stock SetCutZoneFlashForPlayer(playerid, gangzone[4], color) {
    for (new 
i; i < 4; i++) {
        
GangZoneFlashForPlayer(playerid, gangzone[i], color);
    }
}
/*
 * native SetCutZoneStopFlashForPlayer(playerid, gangzone[4]);
 */
stock SetCutZoneStopFlashForPlayer(playerid, gangzone[4]) {
    for (new 
i; i < 4; i++) {
        
GangZoneStopFlashForPlayer(playerid, gangzone[i]);
    }
}
public 
OnGameModeInit()
{
    
CreateCutZone(keepzone, -100.0, -100.0, 100.0, 100.0); //minx, miny, maxx, maxy
    
return 1;
}
public 
OnGameModeExit()
{
    
DestroyCutZone(keepzone); 
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
ShowPlayerCutZone(playerid, keepzone, 0x00000044);
    return 
1;
}
public 
OnPlayerDisconnect(playerid, reason)
{
    
HidePlayerCutZone(playerid, keepzone);
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    
// Keep zone -------------------------------------------------------------------------------
    
static
        
delay[MAX_PLAYERS],
        
bool:keepzone_flash[MAX_PLAYERS]
    ;
    new
        
time = tickcount()
    ;
    if (
delay[playerid] < time) {
        if (!
IsPointInArea3D(playerid, -100.0, -100.0, -100.0, 100.0, 100.0, 100.0)) {
            if (!
keepzone_flash[playerid]) {
                
keepzone_flash[playerid] = true;
                
SetCutZoneFlashForPlayer(playerid, TW_keepzone, 0xFF000077); // If player ouiside of battlefield enable flashed zone
            
}
            
SendClientMessage(playerid, 0xFF0000FF, "You are outside of battlefield. Go back!");
            new
                
Float: hp
            
;
            
GetPlayerHealth(playerid, hp);
            
SetPlayerHealth(playerid, hp - 5.0);
        } else {
            if (
keepzone_flash[playerid]) {
                
SetCutZoneStopFlashForPlayer(playerid, TW_keepzone); // If player in CutZone disable flashed zone
                
keepzone_flash[playerid] = false;
            }
        }
        
delay[playerid] = time + 2000; // while checking the player position 2 sec.
    
}
    
// EOF Keep zone -------------------------------------------------------------------------------
    
return 1;
} 
Reply
#6

Simple but useful...I guess. Looking forward to see it more developed. Good job so far.
Reply
#7

Just like Basic TDM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)