31.12.2009, 20:23
I have a /goto command in dcmd,
It works ingame and everything,
But i want it to check to see if the person typing the command,
Is trying to teleport to himself and if he is to tell him he cannot teleport to himself,
So if my id was 0, And i typed /goto 0, The server wud say: You cannot teleport to yourself,
Like that, So i was wondering if someone could help me,
My code:
If someone could possibly edit that for me.
It works ingame and everything,
But i want it to check to see if the person typing the command,
Is trying to teleport to himself and if he is to tell him he cannot teleport to himself,
So if my id was 0, And i typed /goto 0, The server wud say: You cannot teleport to yourself,
Like that, So i was wondering if someone could help me,
My code:
pawn Код:
dcmd_goto(playerid, params[])
{
if (strlen(params))
{
new id = strval(params);
if (IsPlayerConnected(id))
{
if(IsPlayerAdmin(playerid))
{
new
Float:pPos[ 3 ];
GetPlayerPos(id, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
SetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
SetPlayerInterior(playerid, GetPlayerInterior(id));
SendClientMessage(playerid, COLOR_WHITE, "You've been teleported to the player!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are not an Administrator");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found!");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/goto <playerid>\"");
}
return 1;
}