【自己解决】关于魔兽232修改cs_get_user_money2的问题
本帖最后由 masher0782 于 2009-8-13 05:33 编辑服务器安装了war3ft和无限金钱2
将stocks中的
cs_get_user_money改成cs_get_user_money2
cs_set_user_money改成cs_set_user_money2
然后编译出现一个warning,从未使用的变量Lang_GetSkillInfo
然后插件正常运行,但是购买物品时,当金钱大于16000还是当做16000对待,比如本来有10w,买了个突袭,就变成0了,而且插件是用的cs_set_user_money2改变的金钱数量,本人小白,求解?
=============================
已经自己解决了,stocks.inc里有一段血法师吸钱吸到16000就不吸了的代码,删除问题解决,下面是stocks.inc的代码,兼容无限金钱2插件,下面的压缩包就是stocks.inc,想省钱可以不下。stock diff(num,num2){
if(num>num2)
return (num-num2)
else
return (num2-num)
return 0
}
stock find_target(id,const arg[]) {
new player = find_player("bl",arg)
if(player){
if ( player != find_player("blj",arg) ){
console_print(id,"%L",id,"THERE_ARE_MORE")
return 0
}
}
else if((player = find_player("c",arg) )==0 && arg=='#' && arg )
player = find_player("k",str_to_num(arg))
if(!player){
console_print(id,"%L",id,"CLIENT_NOT_FOUND")
return 0
}
return player
}
stock isPrimary(weapon){
if(weapon==CSW_GALIL||weapon==CSW_FAMAS||weapon==CSW_M3||weapon==CSW_XM1014||weapon==CSW_MP5NAVY||weapon==CSW_TMP ||weapon==CSW_P90||weapon==CSW_MAC10||weapon==CSW_UMP45||weapon==CSW_AK47||weapon==CSW_SG552||weapon==CSW_M4A1||weapon==CSW_AUG||weapon==CSW_SCOUT ||weapon==CSW_AWP||weapon==CSW_G3SG1||weapon==CSW_SG550||weapon==CSW_M249)
return true
return false
}
stock isSecondary(weapon){
if(weapon==CSW_P228||weapon==CSW_ELITE||weapon==CSW_FIVESEVEN||weapon==CSW_USP||weapon==CSW_GLOCK18||weapon==CSW_DEAGLE)
return true
return false
}
stock find_free_spawn(id, iTeamNumber, Float:spawnOrigin, Float:spawnAngle){
new iSpawn
if(iTeamNumber == CTS)
iSpawn=0
else
iSpawn=1
const maxSpawns = 128
new spawnPoints
new ent = -1, spawnsFound = 0
/* Find all of the spawn points */
do {
ent = find_ent_by_class(ent,spawnEntString)
if (ent != 0) {
spawnPoints = ent
spawnsFound++
}
}
while (ent && spawnsFound < maxSpawns)
new bool:foundFreeSpawn
new Float:vicinity = 96.0 //(32x32x96)
new i
new playersInVicinity
new entList
/* Loop through all the spawn points */
for (i = 0;i < spawnsFound && !foundFreeSpawn;i++) {
if(spawnPoints != 0 && !spawnPointsused){
/* Get the origin of the spawn point */
entity_get_vector(spawnPoints,EV_VEC_origin,spawnOrigin)
/* Determine if a player is in this vicinity */
playersInVicinity = find_sphere_class(0, "player", vicinity, entList, 1, spawnOrigin)
/* If not, we want to transport the player here */
if (playersInVicinity == 0){
foundFreeSpawn = true
spawnPointsused = true
}
/* Otherwise we don't */
else{
foundFreeSpawn = false
}
}
#if DEBUG
console_print(id, "[%d] Searching %d, used: %d, found:%d", i, spawnPoints, spawnPointsused, foundFreeSpawn)
#endif
id--
}
if( foundFreeSpawn && spawnPoints ){
entity_get_vector(spawnPoints, EV_VEC_angles, spawnAngle)
return spawnPoints
}
return -1
}
stock get_user_actualhealth(id){
new health = get_user_health(id)
// Player has god mode
if ( health > 1500 )
return health - 2048
// Player will evade the next shot
if ( health > 500 )
return health - 1024
return health
}
stock get_user_maxhealth(id){
new maxHealth = 100
// Human Devotion Skill
if ( Verify_Skill(id, RACE_HUMAN, SKILL2) ){
maxHealth += (p_devotion-1] - 100)
}
// Player has a health bonus from the Periapt of Health
if ( p_data==ITEM_HEALTH ){
maxHealth += iCvar
}
return maxHealth
}
stock Verify_Race(id, race){
if( id == 0 )
return false
if( p_data == race )
return true
else if( (p_data == 9) ){
if ( race9Options == race )
return true
if ( race9Options == race )
return true
if ( race9Options == race )
return true
if ( race9Options == race )
return true
}
return false
}
stock Verify_Skill(id, race, skill){
if( id == 0 )
return false
if( ((p_data == 9 && race9Options == race) || p_data == race) && p_data )
return true
return false
}
stock Status_Text(id, szMessage[], Float:fDuration, Float:iYPos){
#if ADVANCED_DEBUG
writeDebugInfo("WAR3_status_text",0)
#endif
#if MOD == 1
Create_HudText(id, szMessage, 1)
iYPos--
#else
set_hudmessage(255, 208, 0, HUDMESSAGE_POS_CENTER, iYPos, 0, 6.0, fDuration, 0.1, 0.5, HUDMESSAGE_CHAN_STATUS)
show_hudmessage(id, szMessage)
#endif
// Print important messages to console
if ( fDuration > 4.0 ){
console_print( id, "%s %s", g_MODclient, szMessage )
}
}
stock race9_randomize(){
#if ADVANCED_DEBUG
writeDebugInfo("race9_randomize",0)
#endif
if (iCvar == 9){
if (iCvar){
new myintvallocal = 0
// loop through all four skill options (3 + ultimate) pick a new race at random and update the skill
while (myintvallocal < 4){
race9Options = random_num(1,8)
++myintvallocal
}
}
}
}
stock set_user_money(id, money, show = 1){
#if ADVANCED_DEBUG
writeDebugInfo("set_user_money",id)
#endif
if(!p_data_b)
return PLUGIN_CONTINUE
#if MOD == 0
cs_set_user_money2(id,money,show)
#endif
#if MOD == 1
show--
new parm
parm = id
parm = 1
parm = money - get_user_money(id)
p_data=money
_DOD_showMoney(parm)
#endif
return PLUGIN_CONTINUE
}
stock get_user_money(id){
#if ADVANCED_DEBUG
writeDebugInfo("get_user_money",id)
#endif
if(!p_data_b)
return PLUGIN_CONTINUE
#if MOD == 0
new money = cs_get_user_money2(id)
return money
#endif
#if MOD == 1
return p_data
#endif
}
页:
[1]