07.10.2013, 15:33
How do i set a players pos when he's offline cuz thats what im trying to do
pawn Код:
CMD:ogethere(playerid, params[]) // Made by Wizza
{
new playerb[32], string[128], file[32];
new Float:Pos[3];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "s[32]", playerb)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ogethere [playername]");
if(RPIDFN(playerb) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Player is connected to the server, use /gethere instead.");
format(file, sizeof(file), "users/%s.ini", playerb);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
if(PlayerInfo[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you.");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerb, Pos[0]+1, Pos[1], Pos[2]);
SetPlayerInterior(playerb, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(playerb, GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "%s has offline gotten %s to his location", Wizza(playerid), playerb);
SendAdminMessage(COLOR_DARKRED, 1, string);
format(string, sizeof(string), "%s has used /ogethere on %s", Wizza(playerid), playerb);
Log("logs/users.log", string);
return 1;
}