/gethere Command Problem
#1

So, as the title says, i created the command /gethere, everything work but the teleportation not..

It says the message everything work, but the teleportation not.
Please help, i dont know why it happens like this

Code:
Код:
CMD:gethere(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_GREY, "Трябва да сте поне 2 левел Админ!");
    new target;
    new Float:x, Float:y, Float:z;
    new name[MAX_PLAYER_NAME];
    new name2[MAX_PLAYER_NAME];
    new string[128];
    new string2[128];
    if(sscanf(params, "r", target)) return SendClientMessage(playerid, COLOR_WHITE, "Използвай: {FF1E00}/gethere {FFFFFF}[ID]");
    if(IsPlayerInAnyVehicle(playerid))
    {
          GetPlayerName(playerid, name, sizeof(name));
          GetPlayerName(target, name2, sizeof(name2));
	      GetPlayerPos(target, x, y, z);
	      SetVehiclePos(GetPlayerVehicleID(target), x+1, y+1, z+1);
	      format(string, sizeof(string), "Вие телепортирахте до вас {23FF00}%s{FFFFFF}!", name2);
          SendClientMessage(playerid, COLOR_WHITE, string);
          format(string2, sizeof(string2), "Вие бяхте телепортиран до {23FF00}%s{FFFFFF}!", name);
          SendClientMessage(target, COLOR_WHITE, string2);
    }
    else
    {
          GetPlayerName(playerid, name, sizeof(name));
          GetPlayerName(target, name2, sizeof(name2));
          GetPlayerPos(playerid, x, y, z);
          SetPlayerPos(target, x, y+1, z+1);
          format(string, sizeof(string), "Вие телепортирахте до вас {23FF00}%s{FFFFFF}!", name2);
          SendClientMessage(playerid, COLOR_WHITE, string);
          format(string2, sizeof(string2), "Вие бяхте телепортиран до {23FF00}%s{FFFFFF}!", name);
          SendClientMessage(target, COLOR_WHITE, string2);
	}
    return 1;
}
(Ignore bugged text, it is in bulgarian)
Reply
#2

Quote:
Originally Posted by Lixyde
Посмотреть сообщение
So, as the title says, i created the command /gethere, everything work but the teleportation not..

It says the message everything work, but the teleportation not.
Please help, i dont know why it happens like this

Code:
Код:
CMD:gethere(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_GREY, "Трябва да сте поне 2 левел Админ!");
    new target;
    new Float:x, Float:y, Float:z;
    new name[MAX_PLAYER_NAME];
    new name2[MAX_PLAYER_NAME];
    new string[128];
    new string2[128];
    if(sscanf(params, "r", target)) return SendClientMessage(playerid, COLOR_WHITE, "Използвай: {FF1E00}/gethere {FFFFFF}[ID]");
    if(IsPlayerInAnyVehicle(playerid))
    {
          GetPlayerName(playerid, name, sizeof(name));
          GetPlayerName(target, name2, sizeof(name2));
	      GetPlayerPos(target, x, y, z);
	      SetVehiclePos(GetPlayerVehicleID(target), x+1, y+1, z+1);
	      format(string, sizeof(string), "Вие телепортирахте до вас {23FF00}%s{FFFFFF}!", name2);
          SendClientMessage(playerid, COLOR_WHITE, string);
          format(string2, sizeof(string2), "Вие бяхте телепортиран до {23FF00}%s{FFFFFF}!", name);
          SendClientMessage(target, COLOR_WHITE, string2);
    }
    else
    {
          GetPlayerName(playerid, name, sizeof(name));
          GetPlayerName(target, name2, sizeof(name2));
          GetPlayerPos(playerid, x, y, z);
          SetPlayerPos(target, x, y+1, z+1);
          format(string, sizeof(string), "Вие телепортирахте до вас {23FF00}%s{FFFFFF}!", name2);
          SendClientMessage(playerid, COLOR_WHITE, string);
          format(string2, sizeof(string2), "Вие бяхте телепортиран до {23FF00}%s{FFFFFF}!", name);
          SendClientMessage(target, COLOR_WHITE, string2);
	}
    return 1;
}
(Ignore bugged text, it is in bulgarian)
Код:
change if(sscanf(params, "r", target)) on if(sscanf(params, "i", target))
Reply
#3

if you're using different interiors and worlds, I suggest to get player's current virtual world and interior.
Reply
#4

"u" instead of "r" in sscanf line. Not "i" as suggested above.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)