CMD:goto
#2

Quote:
Originally Posted by KamalBa
View Post
Code:
CMD:goto(playerid, params[])
{
     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You need to be RCON for use this command");
     new ID;
     new pn[MAX_PLAYER_NAME];
     new an[MAX_PLAYER_NAME];
     new str[128];
     if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /goto [ID]"); 
     if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: This player is not connected");
     GetPlayerName(playerid, an, MAX_PLAYER_NAME);
     GetPlayerName(ID, pn, MAX_PLAYER_NAME);
     new Float:x;
     new Float:y;
     new Float:z;
     GetPlayerPos(ID, x, y, z);
     SetPlayerPos(playerid, x+1, y+1, z); 
     format(str, sizeof(str), "You have been teleported to %s", pn); 
     SendClientMessage(playerid, 0x00FF00AA, str);
     if(IsPlayerInAnyVehicle(playerid)) 
     {
          GetPlayerPos(ID, x, y, z);
          SetVehiclePos(playerid, x+1, y+1, z); 
     }
     return 1;
}
When I used the command it's says
You need to be RCON for use this command
I tried to join the server with the rcon password it's the same
And i am the owner of the server I can't use that command help..
lol
Because you have a statement right at the top saying...
Code:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You need to be RCON for use this command");
if you want a /goto playerid cmd..

pawn Code:
YCMD:goto(playerid, params[]) {
    new playa;
    if (!sscanf(params, "k<playerLookup_acc>", playa)) {
        if(!IsPlayerConnectEx(playa)) {
            SendClientMessage(playerid, X11_WHITE, "Invalid player!");
            return 1;
        }
        new Float:X,Float:Y,Float:Z,vw,interior;
        GetPlayerPos(playa, X, Y, Z);
        vw = GetPlayerVirtualWorld(playa);
        interior = GetPlayerInterior(playa);
        if(IsPlayerInAnyVehicle(playerid)) {
            new carid = GetPlayerVehicleID(playerid);
            TPEntireCar(carid, interior, vw);
            LinkVehicleToInterior(carid, interior);
            SetVehicleVirtualWorld(carid, vw);
            SetVehiclePos(carid, X, Y, Z);
        } else {
            SetPlayerPos(playerid, X, Y, Z);
        }
        SetPlayerVirtualWorld(playerid, vw);
        SetPlayerInterior(playerid,interior);
        SendClientMessage(playerid, X11_ORANGE, "You have been teleported.");
    } else {
        SendClientMessage(playerid, X11_WHITE, "USAGE: /goto [playerid/name]");
    }
    return 1;
}
Reply


Messages In This Thread
CMD:goto - by KamalBa - 10.06.2015, 14:33
Re: CMD:goto - by Prokill911 - 10.06.2015, 14:36
Re: CMD:goto - by KamalBa - 10.06.2015, 14:38
Re: CMD:goto - by DetoNater - 10.06.2015, 14:39
Re: CMD:goto - by Prokill911 - 10.06.2015, 14:39
Re: CMD:goto - by KamalBa - 10.06.2015, 14:41
Re: CMD:goto - by Prokill911 - 10.06.2015, 14:41
Re: CMD:goto - by KamalBa - 10.06.2015, 14:45
Re: CMD:goto - by SpaceX - 10.06.2015, 14:47
Respuesta: Re: CMD:goto - by alexus - 10.06.2015, 17:29

Forum Jump:


Users browsing this thread: 1 Guest(s)