18.01.2015, 18:44
This only works on your own server, in your own script.
This isn't a hacking tool, merely a tool that will help you get around the world quicker.
Requirements for this setup to work:
An enum of pAdmin
ZCMD
Now, you're wondering what each of these commands does.
They all use the same principle:
if(PlayerInfo[playerid][pAdmin] >= 5)
- This baby here checks if you're an administrator level 5+ or not. How does it do that? Well there's this sweet thing I got from making a login & register system, and it was enumerators. Basically something that gets written inside of an .ini file(a type of text document) that the script uses and reads from. In that .ini, it says:
Admin: X
X = the number it was set to.
It's 0 if you aren't an admin, 1 to 999 if you are. I typically use 1-5.
new Float, Float:y, Float:z;
Defines the Float:X, y, z we want to use in SetPlayerPos.
GetPlayerPos(playerid, x, y, z);
This gets the current position of the player which executed the command. The X, The Y and the Z.
SetPlayerPos(playerid, x, y, z-13);
This sets the player position to his previous X and Y, but adds -13 to the Z.
This doesn't mean it'll set your position right from where you're looking at, or forwards.
It'll set your position from wherever you are to, according to the command, to either West, East, North, South. Or up and down in that case.
Y in a negative(-X) represents South
Y in a positive(+X) represents North
X in a negative(-X) represents West
X in a positive(+X) represents East
Z in a negative(-X) represents down.
Z in a positive(+X) represents up.
I figured you can stick these commands to an OnPlayerKeyStateChange, but for now I'm using the keybinds(Chaos AD keybinder).
If you don't have an enumerator system, or ZCMD, make sure to just copy these lines into your command and you're set:
Edited the X, Y, Z to your own will.
This means, in the case above, changing the "-13" number.
How it can look:
x-1 or x+1
y-1 or y+1
z-1 or z+1
This isn't a hacking tool, merely a tool that will help you get around the world quicker.
Requirements for this setup to work:
An enum of pAdmin
ZCMD
pawn Код:
CMD:east(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x+13, y, z);
}
else
{
SendClientMessage(playerid, red, "Ha, you wish!");
}
return 1;
}
CMD:west(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x-13, y, z);
}
else
{
SendClientMessage(playerid, red, "Ha, you wish!");
}
return 1;
}
CMD:north(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y+13, z);
}
else
{
SendClientMessage(playerid, red, "Ha, you wish!");
}
return 1;
}
CMD:south(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y-13, z);
}
else
{
SendClientMessage(playerid, red, "Ha, you wish!");
}
return 1;
}
CMD:up(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z+13);
}
else
{
SendClientMessage(playerid, red, "Ha, you wish!");
}
return 1;
}
CMD:down(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z-13);
}
else
{
SendClientMessage(playerid, red, "Ha, you wish!");
}
return 1;
}
They all use the same principle:
if(PlayerInfo[playerid][pAdmin] >= 5)
- This baby here checks if you're an administrator level 5+ or not. How does it do that? Well there's this sweet thing I got from making a login & register system, and it was enumerators. Basically something that gets written inside of an .ini file(a type of text document) that the script uses and reads from. In that .ini, it says:
Admin: X
X = the number it was set to.
It's 0 if you aren't an admin, 1 to 999 if you are. I typically use 1-5.
new Float, Float:y, Float:z;
Defines the Float:X, y, z we want to use in SetPlayerPos.
GetPlayerPos(playerid, x, y, z);
This gets the current position of the player which executed the command. The X, The Y and the Z.
SetPlayerPos(playerid, x, y, z-13);
This sets the player position to his previous X and Y, but adds -13 to the Z.
This doesn't mean it'll set your position right from where you're looking at, or forwards.
It'll set your position from wherever you are to, according to the command, to either West, East, North, South. Or up and down in that case.
Y in a negative(-X) represents South
Y in a positive(+X) represents North
X in a negative(-X) represents West
X in a positive(+X) represents East
Z in a negative(-X) represents down.
Z in a positive(+X) represents up.
I figured you can stick these commands to an OnPlayerKeyStateChange, but for now I'm using the keybinds(Chaos AD keybinder).
If you don't have an enumerator system, or ZCMD, make sure to just copy these lines into your command and you're set:
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z-13);
Edited the X, Y, Z to your own will.
This means, in the case above, changing the "-13" number.
How it can look:
x-1 or x+1
y-1 or y+1
z-1 or z+1