AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Testing VoteMap (https://forums.alliedmods.net/showthread.php?t=46261)

spider853 10-22-2006 13:41

Testing VoteMap
 
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" :wink:


-----------------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 10-22-2006 16:35

Re: Testing VoteMap
 
Nobody say nothing... :(


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

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