Admin's SetWorld command by using zcmd and sscanf
#5

pawn Код:
#include <a_samp>
#include <sscanf>
#include <zcmd>

CMD:vw(playerid,params[])
{
    new virtualworld;
    if(sscanf(params,"i",virtualworld)) return SendClientMessage(playerid,-1,"USAGE: /vw [id]");
    {
        if(IsPlayerAdmin(playerid)) {
            new str[64];
            SetPlayerVirtualWorld(playerid,virtualworld);
            format(str,sizeof(str),"You are now in virtual world %d",virtualworld);
            SendClientMessage(playerid,-1,str);
        } else {
            SendClientMessage(playerid,-1,"Only RCON users can access to this command");
        }
    }
    return 1;
}
Here's an example.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)