Raised This Month: $51 Target: $400
 12% 

[DELETED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadowless
Member
Join Date: May 2018
Old 05-12-2018 , 10:08   [DELETED]
Reply With Quote #1

---

Last edited by Shadowless; 05-19-2019 at 06:33.
Shadowless is offline
Send a message via ICQ to Shadowless
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 05-12-2018 , 11:44   Re: [req] random map
Reply With Quote #2

Do some experiments with this. Haven't tryed yet.
Code:
new MapData[][], LoadFile[128], ConfigDir[64]; get_configdir(ConfigDir, charsmax(ConfigDir)); format(LoadFile, charsmax(LoadFile), "%s/maps.ini", ConfigDir); public func()     new Line[20], Map;     new FileOpen = fopen(LoadFile, "r");     while(!feof(FileOpen)){         fgets(FileOpen, Line, charsmax(Line));         trim(Line);         copy(Line, charsmax(Line), MapData[Map]);          Map++;     }     MapData[Map] = EOS;     fclose(FileOpen); }
__________________

Last edited by Relaxing; 05-12-2018 at 15:40. Reason: copy()
Relaxing is offline
Old 05-12-2018, 15:51
Shadowless
This message has been deleted by Shadowless.
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 05-13-2018 , 01:21   Re: [req] random map
Reply With Quote #3

Quote:
Originally Posted by Shadowless View Post
Code:
//// random_map.sma
// C:\Games\Counter-Strike_1.6\cstrike\addons\amxmodx\scripting\random_map.sma(7) : error 009: invalid array size (negative or zero)
// C:\Games\Counter-Strike_1.6\cstrike\addons\amxmodx\scripting\random_map.sma(8) : error 010: invalid function or declaration
// C:\Games\Counter-Strike_1.6\cstrike\addons\amxmodx\scripting\random_map.sma(8) : error 001: expected token: ")", but found "sizeof"
// C:\Games\Counter-Strike_1.6\cstrike\addons\amxmodx\scripting\random_map.sma(8) : error 010: invalid function or declaration
// C:\Games\Counter-Strike_1.6\cstrike\addons\amxmodx\scripting\random_map.sma(8) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 5 Errors.
// Could not locate output file compiled\random_map.amx (compile failed).
//
// Compilation Time: 0,33 sec
// ----------------------------------------



PHP Code:
/* AMX Mod X
*   Random Map
*/

#include <amxmodx>

new MapData[][], LoadFile[128], ConfigDir[64];
get_configdir(ConfigDircharsmax(ConfigDir));
format(LoadFilecharsmax(LoadFile), "%s/maps.ini"ConfigDir);

public 
plugin_init()
{
    
register_plugin("Random Map","1.0","Relaxing")
}

public 
func()
{
    new 
Line[20], Map;
    new 
FileOpen fopen(LoadFile"r");
    while(!
feof(FileOpen)){
        
fgets(FileOpenLinecharsmax(Line));
        
trim(Line);
        
copy(LineMapData[Map]);
        
Map++;
    }
    
MapData[Map] = EOS;
    
fclose(FileOpen);
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 


No, both of our examples don't work. I said to do test using that scale, not to copy paste it. : P
__________________
Relaxing is offline
Old 05-13-2018, 04:59
Shadowless
This message has been deleted by Shadowless.
Old 05-24-2018, 14:04
Shadowless
This message has been deleted by Shadowless.
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 05-24-2018 , 17:22   Re: [req] random map
Reply With Quote #4

I've seen requests like this a couple times Shadowless. It's just a matter of proper searching on Advanced Search at forum. Or deep search the web.
__________________
Relaxing is offline
Old 05-24-2018, 17:38
Shadowless
This message has been deleted by Shadowless.
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-24-2018 , 17:45   Re: [req] random map
Reply With Quote #5

See this thread

https://forums.alliedmods.net/showpo...51&postcount=2
iceeedr is offline
Send a message via Skype™ to iceeedr
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 05-24-2018 , 17:49   Re: [req] random map
Reply With Quote #6

Quote:
Originally Posted by Shadowless View Post
i found lot of but they are not what i want, "maphandler","mapchoiser4","random map on restart",etc... i just want only random map on timeleft from maps list
If I had this issue I would search in this forum for posts inside Suggestions and Requests subforum which contains "maps.txt" or "mapcycle.ini". Yeah, give it a try.
__________________

Last edited by Relaxing; 05-24-2018 at 17:50.
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 10:11.


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