CMD:goto
#1

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))
     GetVehiclePos(ID, x, y, z);
     PutPlayerInVehicle(playerid, ID, 2);
     {
          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..
Reply
#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
#3

Code:
D:\My server\gamemodes\TDM_Script.pwn(1406) : error 017: undefined symbol "IsPlayerConnectEx"
D:\My server\gamemodes\TDM_Script.pwn(1407) : error 017: undefined symbol "X11_WHITE"
D:\My server\gamemodes\TDM_Script.pwn(1416) : error 017: undefined symbol "TPEntireCar"
D:\My server\gamemodes\TDM_Script.pwn(1425) : error 017: undefined symbol "X11_ORANGE"
D:\My server\gamemodes\TDM_Script.pwn(1427) : error 017: undefined symbol "X11_WHITE"

Error: 5
Reply
#4

remove the if condition in 2nd line or try
/rcon login password in-game
Reply
#5

pawn Code:
YCMD:gethere(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(playerid, X, Y, Z);
        vw = GetPlayerVirtualWorld(playerid);
        interior = GetPlayerInterior(playerid);
        if(IsPlayerInAnyVehicle(playa)) {
            new carid = GetPlayerVehicleID(playa);
            TPEntireCar(carid, interior, vw);
            LinkVehicleToInterior(carid, interior);
            SetVehicleVirtualWorld(carid, vw);
            SetVehiclePos(carid, X, Y, Z);
        } else {
            SetPlayerPos(playa, X, Y, Z);
            SetPlayerVirtualWorld(playa, vw);
            SetPlayerInterior(playa,interior);
        }
        SendClientMessage(playa, X11_ORANGE, "You have been teleported.");
    } else {
        SendClientMessage(playerid, X11_WHITE,  "USAGE: /gethere [playerid/name]");
    }
    return 1;
}

If you want to make it so they come to you..
The above code..
It's just a reverse of /goto basically.
Reply
#6

Quote:
Originally Posted by DetoNater
View Post
remove the if condition in 2nd line or try
/rcon login password in-game
after i do it look what happened

SERVER:Bad admin password. Repeated attempts will get you banned
Reply
#7

Quote:
Originally Posted by KamalBa
View Post
Code:
D:\My server\gamemodes\TDM_Script.pwn(1406) : error 017: undefined symbol "IsPlayerConnectEx"
D:\My server\gamemodes\TDM_Script.pwn(1407) : error 017: undefined symbol "X11_WHITE"
D:\My server\gamemodes\TDM_Script.pwn(1416) : error 017: undefined symbol "TPEntireCar"
D:\My server\gamemodes\TDM_Script.pwn(1425) : error 017: undefined symbol "X11_ORANGE"
D:\My server\gamemodes\TDM_Script.pwn(1427) : error 017: undefined symbol "X11_WHITE"

Error: 5

In your gamemode at the top

Put
#include <sscanf2>
"IsPlayerConnectEx"
Into
"IsPlayerConnected"
Reply
#8

Code:
D:\My server\gamemodes\TDM_Script.pwn(1409) : error 029: invalid expression, assumed zero
D:\My server\gamemodes\TDM_Script.pwn(1409) : warning 215: expression has no effect
D:\My server\gamemodes\TDM_Script.pwn(1409) : error 001: expected token: ";", but found ")"
D:\My server\gamemodes\TDM_Script.pwn(1409) : error 029: invalid expression, assumed zero
D:\My server\gamemodes\TDM_Script.pwn(1409) : fatal error 107: too many error messages on one line
How to fix ?
Reply
#9

What is the expression at line 1409?
Reply
#10

Quote:
Originally Posted by KamalBa
View Post
after i do it look what happened

SERVER:Bad admin password. Repeated attempts will get you banned
The rcon password is defined in your server.cfg file. You are using a wrong password.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)