Raised This Month: $ Target: $400
 0% 

[HELP] If Mapname Then Give Wep + Ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 04-22-2018 , 09:47   Re: [HELP] If Mapname Then Give Wep + Ammo
Reply With Quote #1

Basically this stock returns a value depending on it searches. So we are looking for a value of a map, lets say: get_value_from_data("de_dust")
The stock will quickly look up at the file & get it's value, only if the map is on the file.
Code:
new map_int = get_value_from_data("de_dust2") if (map_int == 1)     server_print("playing on dust 2") else if (map_int == 0)     server_print("map not listed on the file")
map_data.dat examples
"de_dust2" 1
"de_dust" 2
"de_inferno" 3
"cs_assault" 4

You can get rid of add_map. You can manually configure them on the file.

Reminder: Don't set a map's value 0, the 0 is the default value of an undefined integer. The stock get's an number from a map, if the map doesn't exists then the integer won't have a call. (you can get rid of it if you set it on "-1". ReturnValue = -1;
__________________
Relaxing is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode