What it's wrong with this ?
#1

pawn Код:
CMD:get(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] >= 1)
    {
        new ID;
        new Float:X;
        new Float:Y;
        new Float:Z;
        new Float:A;
        if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"{FF0000}AdmUsage: {15FF00}/Get [ID]");
        GetPlayerPos(playerid, X,Y,Z);
        GetPlayerFacingAngle(playerid, A);
        SetPlayerPos(ID, X,Y,Z);
        SendClientMessage(playerid, -1, "{FF0000}AdmCmd: {15FF00}You teleported to your position specified player !");
        SendClientMessage(ID,-1, "{FF0000}AdmCmd: {15FF00}You have been teleported to an Administrator position !");
    }
    else
    {
        SendClientMessage(playerid, -1, "{FF0000}ERROR: {15FF00}You are not authorized to use this command !");
    }
    return 1;
}
- No errors, nothing happen' In-Game ...
Reply
#2

Try this instead:

pawn Код:
CMD:get(playerid, params[])
{
    if(PlayerInfo[playerid][Admin] == 0) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {15FF00}You are not authorized to use this command !");
    new ID;
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "{FF0000}AdmUsage: {15FF00}/Get [ID]");
    if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {15FF00}Player not connected !");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(ID, x, y, z);
    SendClientMessage(playerid, -1, "{FF0000}AdmCmd: {15FF00}You teleported to your position specified player !");
    SendClientMessage(ID, -1, "{FF0000}AdmCmd: {15FF00}You have been teleported to an Administrator position !");
    return 1;
}
Reply
#3

If you're using it on yourself, you'll see nothing.
If you're using it on someother player, make sure both of you are in the same interior and virtual world.
You could still add SetPlayerInterior(ID, GetPlayerInterior(playerid)), SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid)); before setting the ID's position.
Reply
#4

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Try this instead:

pawn Код:
CMD:get(playerid, params[])
{
    if(PlayerInfo[playerid][Admin] == 0) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {15FF00}You are not authorized to use this command !");
    new ID;
    if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "{FF0000}AdmUsage: {15FF00}/Get [ID]");
    if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{FF0000}ERROR: {15FF00}Player not connected !");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(ID, x, y, z);
    SendClientMessage(playerid, -1, "{FF0000}AdmCmd: {15FF00}You teleported to your position specified player !");
    SendClientMessage(ID, -1, "{FF0000}AdmCmd: {15FF00}You have been teleported to an Administrator position !");
    return 1;
}
Works. :P +rep !


Quote:
Originally Posted by biker122
Посмотреть сообщение
If you're using it on yourself, you'll see nothing.
If you're using it on someother player, make sure both of you are in the same interior and virtual world.
You could still add SetPlayerInterior(ID, GetPlayerInterior(playerid)), SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid)); before setting the ID's position.
Thank you,

DanishHaq code works, but you gave to me an idea !


// EDIT:

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)