Raised This Month: $ Target: $400
 0% 

small coding questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-03-2012 , 02:47   small coding questions
Reply With Quote #1

How can i change the map in my sma once a condition has been met?

I know its possible with server_cmd( amx_map de_dust_cz ) but im looking for a better way.
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-03-2012 at 06:52.
striker07 is offline
isotonic
AlliedModders Donor
Join Date: Jun 2011
Location: Moscow, Russia
Old 08-03-2012 , 03:38   Re: Change map from sma
Reply With Quote #2

Hmmm. And how exactly better?
__________________
isotonic is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-03-2012 , 05:50   Re: Change map from sma
Reply With Quote #3

nvm, I was wondering if there was one.

got another question: How can i add " in the beginning and end of a players name so that i can perform a command on that player

example:
PHP Code:
new idname[32];
    
get_user_name(ididnamecharsmax(idname) );
    
server_cmd("give_portal %s"idname); 
this wont work when a players name has spaces in it so the name wont be recognized so it should be
PHP Code:
new idname[32];
    
get_user_name(ididnamecharsmax(idname) );
    
server_cmd("give_portal "%s" "idname); 
but that doesnt work neighter
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-03-2012 at 06:50.
striker07 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-03-2012 , 06:59   Re: small coding questions
Reply With Quote #4

It doesnt work neighter when i do this:
PHP Code:
new idname[32];
    
get_user_name(ididnamecharsmax(idname) );
    new 
givecommand[34];
    
format(givecommandcharsmax(givecommand), "%s"idname );
    
server_cmd("give_portal %s"givecommand); 
im out of options :S
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 08-03-2012 , 07:04   Re: small coding questions
Reply With Quote #5

PHP Code:
server_cmd("give_portal ^"%s^""idname); 
or use the userid instead. It's much better

Last edited by DjOptimuS; 08-03-2012 at 07:04.
DjOptimuS is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-03-2012 , 11:08   Re: small coding questions
Reply With Quote #6

aha nice thanks

edit:
PHP Code:
new idname[32];
   
get_user_name(ididnamecharsmax(idname) );
   
server_cmd("give_portal ^"%s^""idname); 
is not working neighter
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-03-2012 at 11:31.
striker07 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2012 , 22:27   Re: small coding questions
Reply With Quote #7

Here is the more direct route. Skips the extra code of amx_map.
Code:
server_cmd("changelevel dod_kalt")
__________________
fysiks is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-05-2012 , 06:47   Re: small coding questions
Reply With Quote #8

thanks, you know how to do it for the give_portal command?
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2012 , 12:50   Re: small coding questions
Reply With Quote #9

Quote:
Originally Posted by striker07 View Post
thanks, you know how to do it for the give_portal command?
Do what with that command? I don't even know what that command is.
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-05-2012 , 14:16   Re: small coding questions
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
Do what with that command? I don't even know what that command is.
Im almost certain its for the portal gun plugin that was never finished lol.. (works though)
Doc-Holiday 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 21:35.


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