Komanda .map

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
xedga
Jau po truputį tampa savu
Posts: 154
Joined: 2010 Sep 24 20:12
Skype: xedga-beribu
Location: Šiauliai/Kaunas

Komanda .map

Post by xedga »

Code: Select all

public map_say(id) {        if(!(get_user_flags(id) & ACCESS_LEVEL))        return PLUGIN_CONTINUE        static said[30]        read_argv(1, said, charsmax(said))        if(equal(said, ".map", 5)) {                replace(said, charsmax(said), ".map ", "")                server_cmd("changelevel #%d", said)                return PLUGIN_HANDLED    }        return PLUGIN_CONTINUE}
Bandau parašyti koda, kad per chat galėtum pakeisti mapa, as cia toks pradedantysis, tai nzn gal visai ne taip darau, prašau pagalbos.

newb
Pluginų patvirtintojas
Posts: 1047
Joined: 2010 Sep 23 21:43
Location: Wonderland
Contact:

Re: Komanda .map

Post by newb »

Code: Select all

#include <amxmodx>#include <amxmisc> public plugin_init() {    register_clcmd("say", "map_say", ADMIN_MAP)} public map_say(id, level, cid) {        if (!cmd_access(id, level, cid, 2))        return PLUGIN_CONTINUE        new said[30]        read_argv(1, said, charsmax(said))        if(equal(said, ".map", 4)) {                replace(said, charsmax(said), ".map ", "")                if (is_map_valid(said)) server_cmd("changelevel %s", said)        else client_print(id, 3, "Blogas map")                return PLUGIN_HANDLED    }        return PLUGIN_CONTINUE}
Last edited by newb on 2011 Dec 29 13:29, edited 1 time in total.

xedga
Jau po truputį tampa savu
Posts: 154
Joined: 2010 Sep 24 20:12
Skype: xedga-beribu
Location: Šiauliai/Kaunas

Re: Komanda .map

Post by xedga »

Ačiū newb, +karma

newb
Pluginų patvirtintojas
Posts: 1047
Joined: 2010 Sep 23 21:43
Location: Wonderland
Contact:

Re: Komanda .map

Post by newb »

Blogai truputi buvau padares, koda pataisiau.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests