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(PLUGIN, VERSION, AUTHOR)
new name[50]
copy(name, 49,"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(menu, 99, "Which Map?^n^n1. de_aztec^n2. de_dust^n3. de_dust2^n^n0. Exit")
show_menu(id, keys, menu)
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])
}