SA-MP Forums Archive
Need me /setworld command.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need me /setworld command.. (/showthread.php?tid=288643)



Need me /setworld command.. - dundolina - 08.10.2011

Is explained in the title .. If you do not understand I want to change the world with a player command.


Re: Need me /setworld command.. - Jafet_Macario - 08.10.2011

pawn Код:
YCMD:setworld(playerid, o[], help)
{
    if(help) return SendClientMessage(playerid, -1, "Change a player world");
    new id, world, name[ MAX_PLAYER_NAME ], name2[ MAX_PLAYER_NAME ], string[ 128 ];
    if(sscanf(o,"ui", id, world)) return SendClientMessage(playerid, -1, "Syntax Error: /setworld [PlayerName/ID] [World]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "This player is offline"):
    GetPlayerName(playerid, name, MAX_PLAYER_NAME); GetPlayerName(id, name2, MAX_PLAYER_NAME);
    format(string, sizeof(string),"%s has changed %s virtual world to %d", name, name2, world);
    SendClientMessageToAll(-1, string);
    SetPlayerVirtualWorld(id, world);
    return 1;
}