Raised This Month: $ Target: $400
 0% 

Testing VoteMap


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spider853
Senior Member
Join Date: Jul 2006
Old 10-22-2006 , 13:41   Testing VoteMap
Reply With Quote #1

Hi There !
I Start To Learn Pawn Language and To Make AMXX Plugins..
For Start I Wanned to Make A VoteMap Plugin But I Dont Really know if this Code is Teoreticaly Correct!... Is Working But Do I Make The Timer Work Correctly??

P.S.:Question:
How I Can Concate 2 Strings in a Function (like in c++)
SomeFunction("string1" + "string2")
Or I AllWays Need To Make A Temporary variable To Store The Strings??
new temp[50]
copy(temp,49,"string1")
copy(temp,49,"string2")
???
I Will Be Very Glad if Somebody Help's Me In This "Start"


-----------------Code--------------------

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Demo PLUGIN"
#define VERSION "1.0"
#define AUTHOR "Spider"
 
new maps[3][] = {"de_aztec","de_dust","de_dust2"}
 
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    new 
name[50
    
copy(name49,"Choise Next Map")
    new 
keys MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
    register_menucmd
(register_menuid("Which Map?"), keys"VoteMap")
    
register_clcmd("amx_vote_map""ShowMapVote")
    
// Add your code here...
}
public 
ShowMapVote(id) {
    new 
menu[100]
    new 
keys MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
    format
(menu99"Which Map?^n^n1. de_aztec^n2. de_dust^n3. de_dust2^n^n0. Exit")
    
show_menu(idkeysmenu)
    return 
PLUGIN_HANDLED
}
public 
VoteMap(id,key) {
    new 
temp[50]
    
console_print(id,maps[key])
    
copy(temp,49,"changelevel ")
    
strcat(temp,maps[key],49)
    
set_task(10.0,"ChangeMap",0,temp,50)
}
public 
ChangeMap(params[],id) {
    
server_cmd(params[0])

spider853 is offline
Send a message via ICQ to spider853
spider853
Senior Member
Join Date: Jul 2006
Old 10-22-2006 , 16:35   Re: Testing VoteMap
Reply With Quote #2

Nobody say nothing...
spider853 is offline
Send a message via ICQ to spider853
Reply


Thread Tools
Display Modes

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:55.


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