#include #include "W3SIncs/War3Source_Interface" public Plugin:myinfo= { name="W3S Engine XP Gold CS", author="Ownz (DarkEnergy)", description="War3Source Core Plugins", version="1.0", url="http://war3source.com/" }; public LoadCheck(){ return GameCS(); } // cs new Handle:DefuseXPCvar; new Handle:PlantXPCvar; new Handle:RescueHostageXPCvar; //10 hostages? new Handle:touchedHostage[MAXPLAYERSCUSTOM]; public OnPluginStart() { for(new i=0;i0) { new client=GetClientOfUserId(GetEventInt(event,"userid")); new Float:origin[3]; GetClientAbsOrigin(client,origin); new team=GetClientTeam(client); new Float:otherorigin[3]; for(new i=1;i<=MaxClients;i++){ if(ValidPlayer(i,true)&&GetClientTeam(i)==team){ GetClientAbsOrigin(i,otherorigin); if(GetVectorDistance(origin,otherorigin)<1000.0&&War3_GetRace(i)>0){ // Called when a player defuses the bomb //new race=War3_GetRace(i); new addxp=(W3GetKillXP(i)*GetConVarInt(DefuseXPCvar))/100; new String:defusaward[64]; new String:helpdefusaward[64]; Format(defusaward,sizeof(defusaward),"%T","defusing the bomb",i); Format(helpdefusaward,sizeof(helpdefusaward),"%T","being near bomb defuse",i); W3GiveXPGold(i,XPAwardByBomb,addxp,0,i==client?defusaward:helpdefusaward); } } } } } public War3Source_BombPlantedEvent(Handle:event,const String:name[],bool:dontBroadcast) { if(GetEventInt(event,"userid")>0) { new client=GetClientOfUserId(GetEventInt(event,"userid")); new Float:origin[3]; GetClientAbsOrigin(client,origin); new team=GetClientTeam(client); new Float:otherorigin[3]; for(new i=1;i<=MaxClients;i++){ if(ValidPlayer(i,true)&&GetClientTeam(i)==team){ GetClientAbsOrigin(i,otherorigin); if(GetVectorDistance(origin,otherorigin)<1000.0&&War3_GetRace(i)>0){ // Called when a player plants the bomb //new race=War3_GetRace(i); new addxp=(W3GetKillXP(i)*GetConVarInt(PlantXPCvar))/100; new String:plantaward[64]; new String:helpplantaward[64]; Format(plantaward,sizeof(plantaward),"%T","planting the bomb",i); Format(helpplantaward,sizeof(helpplantaward),"%T","being near bomb plant",i); W3GiveXPGold(i,XPAwardByBomb,addxp,0,i==client?plantaward:helpplantaward); } } } } } public War3Source_HostageFollow(Handle:event,const String:name[],bool:dontBroadcast) { if(GetEventInt(event,"userid")>0) { new client=GetClientOfUserId(GetEventInt(event,"userid")); new hostage=GetEventInt(event,"hostage"); if(FindValueInArray(touchedHostage[client],hostage)==-1){ PushArrayCell(touchedHostage[client],hostage); //new race=War3_GetRace(client); new addxp=(W3GetKillXP(client)*GetConVarInt(RescueHostageXPCvar))/100; new String:hostageaward[64]; Format(hostageaward,sizeof(hostageaward),"%T","touching a hostage",client); W3GiveXPGold(client,XPAwardByHostage,addxp,0,hostageaward); } } } public War3Source_HostageRescuedEvent(Handle:event,const String:name[],bool:dontBroadcast) { if(GetEventInt(event,"userid")>0) { new client=GetClientOfUserId(GetEventInt(event,"userid")); // Called when a player rescues a hostage //new race=War3_GetRace(client); new addxp=(W3GetKillXP(client)*GetConVarInt(RescueHostageXPCvar))/100; new String:hostageaward[64]; Format(hostageaward,sizeof(hostageaward),"%T","rescuing a hostage",client); W3GiveXPGold(client,XPAwardByHostage,addxp,0,hostageaward); } } public War3Source_HostageKilled(Handle:event,const String:name[],bool:dontBroadcast) { if(GetEventInt(event,"userid")>0) { new client=GetClientOfUserId(GetEventInt(event,"userid")); // Called when a player rescues a hostage //new race=War3_GetRace(client); new addxp=-2*(W3GetKillXP(client)*GetConVarInt(RescueHostageXPCvar))/100; new String:hostageaward[64]; Format(hostageaward,sizeof(hostageaward),"%T","killing a hostage",client); W3GiveXPGold(client,XPAwardByHostage,addxp,0,hostageaward); } }