LP and SP
#1

hello everyone i made a cmd for saving players current position and then teleporting them to those saved positions
here's the cmd

pawn Код:
CMD:sp(playerid,params[])
{
    #pragma unused params
    if(gPlayerInfo[playerid][LoggedIn] == 1 && gPlayerInfo[playerid][Level] >= 1)
    {
        new Float:x,Float:y,Float:z, interior, file[1000];
        GetPlayerPos(playerid,x,y,z);
        format(file, sizeof(file), PlayerFile);
        interior = GetPlayerInterior(playerid);

        dini_IntSet(file,"x",floatround(x));
        dini_IntSet(file,"y",floatround(y));
        dini_IntSet(file,"z",floatround(z));
        dini_IntSet(file,"interior",interior);
        dini_IntSet(file,"world", (GetPlayerVirtualWorld(playerid)));
        return SendClientMessage(playerid,COLOR_YELLOW,"~~ Coordinates of your position successfully saved! ~~");
    }
    else return SendClientMessage(playerid,red, "ERROR: You must be an administrator to use this command");
}
CMD:lp(playerid,params[])
{
    #pragma unused params
    if(gPlayerInfo[playerid][Level] >= 1)
    {
        new file[1000], Float:x, Float:y, Float:z;
        format(file, sizeof(file), PlayerFile);
        if (dini_Int(file, "x") != 0)
        {
            dini_Int(file, "x");
            dini_Int(file, "y");
            dini_Int(file, "z");
            SetPlayerPos(playerid,x,y,z);
            SetPlayerVirtualWorld(playerid, dini_Int(file, "world") );
            return SendClientMessage(playerid,COLOR_YELLOW,"~~ You have been teleported to your saved position ~~");
        }
        else return SendClientMessage(playerid,red,"ERROR: You not have a saved Position! (/gotoplace)");
    }
    else return SendClientMessage(playerid,red, "ERROR: You must be an administrator to use this command");
}
Reply


Messages In This Thread
LP and SP - by CBCandyBoy - 30.03.2013, 14:02
Re: LP and SP - by Lady-Happy - 30.03.2013, 14:04
Re: LP and SP - by CBCandyBoy - 30.03.2013, 14:06
Re: LP and SP - by RajatPawar - 30.03.2013, 14:10
Re: LP and SP - by CBCandyBoy - 30.03.2013, 14:14
Re: LP and SP - by Jochemd - 30.03.2013, 14:16
Re: LP and SP - by CBCandyBoy - 30.03.2013, 14:20
Re: LP and SP - by CBCandyBoy - 30.03.2013, 14:26
Re: LP and SP - by Pawnie - 30.03.2013, 15:01

Forum Jump:


Users browsing this thread: 2 Guest(s)