new CP_Base_PlayersToCheck;
new CP_Base_PlayerCheckID[MAX_PLAYERS];
const CP_Base_BasesToCheck=9;
new CP_Base_Checkpoint[CP_Base_BasesToCheck];
new CP_Base_Owner[CP_Base_BasesToCheck];
new CP_Base_Counter[CP_Base_BasesToCheck];
new CP_Base_CounterModifiedRecently[CP_Base_BasesToCheck];
new Float:CP_Base_Pos[CP_Base_BasesToCheck][3]=
{
{1682.7716,-2286.5437,-1.2347}, // CPBase_LS_Airport
{1157.7881,-2037.0204,69.0078}, // CPBase_LS_Castle
{2263.3303,27.7052,26.4306}, // CPBase_LS_Montgomery
{-1485.0216,-367.2024,15.2949}, // CPBase_SF_AirPort
{-2324.6926,-1637.6180,483.7031}, // CPBase_SF_Chilliad
{-2210.5786,-2375.0747,31.3332}, // CPBase_SF_AngelPine
{1680.0149,1447.9613,10.7739}, // CPBase_LV_AirPort
{491.6579,884.7720,-31.0023}, // CPBase_LV_HunterQuarry
{-2091.0764,2313.4854,25.9141}, // CPBase_LV_BaySide
};
public OnGameModeInit()
//---------------------
SetTimer("TimerBases",1000,true);
for(new CP=0;CP<CP_Base_BasesToCheck;CP++)
{
CP_Base_Checkpoint[CP] = CreateCheckpoint(-1,CP_Base_Pos[CP][0],CP_Base_Pos[CP][1],CP_Base_Pos[CP][2],8.0,80.0);
}
public OnPlayerEnterStreamedCheckpoint(playerid,streamid)
//--------------------------------------------------------
{
for(new CP=0;CP<CP_Base_BasesToCheck;CP++)
{
if(streamid == CP_Base_Checkpoint[CP])
{
CP_Base_PlayersToCheck++;
CP_Base_PlayerCheckID[CP_Base_PlayersToCheck]=playerid;
SendClientMessageToAll(0xffffff,"Base CP Entered.");
return 1;
}
}
}
forward TimerBases();
public TimerBases()
//---------------------
{
if(CP_Base_PlayersToCheck>0)
{
for(new BaseM=0;BaseM<CP_Base_BasesToCheck;BaseM++)
{
CP_Base_CounterModifiedRecently[BaseM]=0;
}
for(new BCPpc=0;BCPpc<CP_Base_PlayersToCheck;BCPpc++)
{
new Float:X,Float:Y,Float:Z,InRange;
GetPlayerPos(CP_Base_PlayerCheckID[BCPpc],Float:X,Float:Y,Float:Z);
for(new CP=0;CP<12;CP++)
{
InRange=IsPlayerInRangeOfPoint(CP_Base_PlayerCheckID[BCPpc],15,CP_Base_Pos[CP][0],CP_Base_Pos[CP][1],CP_Base_Pos[CP][2]);
if (InRange==1)
{
SendClientMessageToAll(0xffffffff,"in range.");
CP_Base_CounterModifiedRecently[CP]=1;
CP_Base_Counter[CP]++;
if(CP_Base_Counter[CP]<10)
{
new string[128];
format(string,sizeof(string),"[%d] Base %d - Team %d - time to take control: %d",CP_Base_Owner[CP],CP,gTeam[CP_Base_PlayerCheckID[BCPpc]],CP_Base_Counter[CP]);
SendClientMessageToAll(0xffffffff,string);
}
else if (InRange==0)
{
CP_Base_Owner[CP]=gTeam[CP_Base_PlayerCheckID[BCPpc]];
new string[128];
format(string,sizeof(string),"[%d] Base %d - Team %d - took over base",CP_Base_Owner[CP],CP,gTeam[CP_Base_PlayerCheckID[BCPpc]]);
SendClientMessageToAll(0xffffffff,string);
}
}
// else
// {
// CP_Base_PlayerCheckID[BCPpc]=CP_Base_PlayerCheckID[CP_Base_PlayersToCheck];
// CP_Base_PlayersToCheck--;
// SendClientMessageToAll(0xffffffff,"1 player is not adding score to a Base Counter anymore.");
// }
}
}
for(new BaseM=0;BaseM<CP_Base_BasesToCheck;BaseM++)
{
if(CP_Base_CounterModifiedRecently[BaseM]==0)
{
CP_Base_Counter[BaseM]=0;
}
}
}
#include <cps>//credits to dragsta
public OnGameModeInit()
{
SetTimer("TimerBases",1000,true);
{
for(new CP=0;CP<CP_Base_BasesToCheck;CP++)
{
CP_Base_Checkpoint[CP] = CreateCheckpoint(-1,CP_Base_Pos[CP][0],CP_Base_Pos[CP][1],CP_Base_Pos[CP][2],8.0,80.0);
}
C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(155) : error 018: initialization data exceeds declared size C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(769) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(770) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(840) : error 017: undefined symbol "strtok" C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(840) : error 033: array must be indexed (variable "cmd") C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(843) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(844) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(845) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(846) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(847) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(848) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(849) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(853) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(854) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(855) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(856) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(857) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(858) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(859) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(860) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(861) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(862) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(863) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(864) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(865) : error 004: function "SendPlayerFormattedText" is not implemented C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(866) : error 004: function "SendPlayerFormattedText" is not implemented Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 26 Errors.
wow, you copied it pretty fast, after posting it, i had to correct some bugs...
search in your script, if theres already a "OnGameModeInit".. then add this inside:
SetTimer("TimerBases",1000,true);
for(new CP=0;CP<CP_Base_BasesToCheck;CP++)
{
CP_Base_Checkpoint[CP] = CreateCheckpoint(-1,CP_Base_Pos[CP][0],CP_Base_Pos[CP][1],CP_Base_Pos[CP][2],8.0,80.0);
}
|
Originally Posted by Babul
Code:
wow, you copied it pretty fast, after posting it, i had to correct some bugs...
search in your script, if theres already a "OnGameModeInit".. then add this inside:
SetTimer("TimerBases",1000,true);
for(new CP=0;CP<CP_Base_BasesToCheck;CP++)
{
CP_Base_Checkpoint[CP] = CreateCheckpoint(-1,CP_Base_Pos[CP][0],CP_Base_Pos[CP][1],CP_Base_Pos[CP][2],8.0,80.0);
}
|
C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(46) : error 018: initialization data exceeds declared size C:\Users\ELLIOT\Desktop\CodServer\gamemodes\lvdm.pwn(1701) : error 017: undefined symbol "CreateCheckpoint"
{-2091.0764,2313.4854,25.9141}, // CPBase_LV_BaySide
{-2091.0764,2313.4854,25.9141} // CPBase_LV_BaySide