[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(playeridFloat:minxFloat:minyFloat:minzFloat:maxxFloat:maxyFloat:maxz) {
    new
        
Floatx,
        
Floaty,
        
Floatz
    
;
    if (!
GetPlayerPos(playeridxyz)) return false;
    if (
>= minx && <= maxx && >= miny && <= maxy && >= minz && <= 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:minxFloat:minyFloat:maxxFloat:maxy
{
    
gangzone[0] = GangZoneCreate(minxmaxymaxx3000.0);         // top
    
gangzone[1] = GangZoneCreate(-3000.0, -3000.0minx3000.0);   // left
    
gangzone[2] = GangZoneCreate(minx, -3000.0maxxminy);        // bottom
    
gangzone[3] = GangZoneCreate(maxx, -3000.03000.03000.0);    // right
}
/*
 * native ShowPlayerCutZone(playerid, gangzone[4], color);
 */
stock ShowPlayerCutZone(playeridgangzone[4], color) {
    for (new 
i4i++) {
        
GangZoneShowForPlayer(playeridgangzone[i], color);
    }
}
/*
 * native HidePlayerCutZone(playerid, gangzone[4]);
 */
stock HidePlayerCutZone(playeridgangzone[4]) {
    for (new 
i4i++) {
        
GangZoneHideForPlayer(playeridgangzone[i]);
    }
}
/*
 * native ShowAllCutZone(gangzone[4], color);
 */
stock ShowAllCutZone(gangzone[4], color) {
    for (new 
i4i++) {
        
GangZoneShowForAll(gangzone[i], color);
    }
}
/*
 * native HideAllCutZone(gangzone[4]);
 */
stock HideAllCutZone(gangzone[4]) {
    for (new 
i4i++) {
        
GangZoneHideForAll(gangzone[i]);
    }
}
/*
 * native DestroyCutZone(gangzone[4]);
 */
stock DestroyCutZone(gangzone[4]) {
    for (new 
i4i++) {
        
GangZoneHideForAll(gangzone[i]);
        
GangZoneDestroy(gangzone[i]);
    }
}
/*
 * native SetCutZoneFlashForPlayer(playerid, gangzone[4], color);
 */
stock SetCutZoneFlashForPlayer(playeridgangzone[4], color) {
    for (new 
i4i++) {
        
GangZoneFlashForPlayer(playeridgangzone[i], color);
    }
}
/*
 * native SetCutZoneStopFlashForPlayer(playerid, gangzone[4]);
 */
stock SetCutZoneStopFlashForPlayer(playeridgangzone[4]) {
    for (new 
i4i++) {
        
GangZoneStopFlashForPlayer(playeridgangzone[i]);
    }
}
public 
OnGameModeInit()
{
    
CreateCutZone(keepzone, -100.0, -100.0100.0100.0); //minx, miny, maxx, maxy
    
return 1;
}
public 
OnGameModeExit()
{
    
DestroyCutZone(keepzone); 
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
ShowPlayerCutZone(playeridkeepzone0x00000044);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
HidePlayerCutZone(playeridkeepzone);
    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.0100.0100.0100.0)) {
            if (!
keepzone_flash[playerid]) {
                
keepzone_flash[playerid] = true;
                
SetCutZoneFlashForPlayer(playeridTW_keepzone0xFF000077); // If player ouiside of battlefield enable flashed zone
            
}
            
SendClientMessage(playerid0xFF0000FF"You are outside of battlefield. Go back!");
            new
                
Floathp
            
;
            
GetPlayerHealth(playeridhp);
            
SetPlayerHealth(playeridhp 5.0);
        } else {
            if (
keepzone_flash[playerid]) {
                
SetCutZoneStopFlashForPlayer(playeridTW_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)