30.03.2013, 14:02
(
Последний раз редактировалось CBCandyBoy; 30.03.2013 в 14:03.
Причина: forgot tags
)
hello everyone i made a cmd for saving players current position and then teleporting them to those saved positions
here's the cmd
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");
}