11.02.2012, 13:54
Quote:
|
I'm looking for this - https://sampforum.blast.hk/showthread.php?tid=32688
Have anyone link for it? Please help. |
?
|
I'm looking for this - https://sampforum.blast.hk/showthread.php?tid=32688
Have anyone link for it? Please help. |
.
CMD:stats(playerid, params[])
{
ShowStats(playerid);
return 1;
}
stock ShowStats(playerid)
{
//Your player stats code here.
return 1;
}
new position;
COMMAND:SavePos(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
new Float:x, Float:y, Float:z;
position[playerid] = GetPlayerPos(playerid, x, y, z);
return 1;
}
COMMAND:Back(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
SetPlayerPos(playerid,position,0.0,0.0,3.0);
return 1;
}
|
Hello, I need two commands:
- one to store my current position - and another one to teleport back to the position stored previously I tried something like this but failed: Code:
new position;
COMMAND:SavePos(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
new Float:x, Float:y, Float:z;
position[playerid] = GetPlayerPos(playerid, x, y, z);
return 1;
}
COMMAND:Back(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 1;
SetPlayerPos(playerid,position,0.0,0.0,3.0);
return 1;
}
|
new Float: PosX[MAX_PLAYERS];
new Float: PosY[MAX_PLAYERS];
new Float: PosZ[MAX_PLAYERS];
CMD:savepos(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PosX[playerid] = x;
PosY[playerid] = y;
PosZ[playerid] = z;
}
else SendClientMessage(playerid, -1,"You are not rcon admin.");
return 1;
}
CMD:loadpos(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
}
else SendClientMessage(playerid, -1,"You are not rcon admin.");
return 1;
}