I need /goto , Command please reply fast!
#1

Hi guys my server is in build so I need a goto command fast.I've found one but doesen't work i have problems with it thanks if you help me with that.
The command when you just type /goto should be looking like this,
/goto [player,ID]
Thanks.
HostName: HostName: Life for Speed Drift4life 24/7
Address: 213.135.162.207:7777
Players: 15 / 50
Ping: 6
Mode: Life For Speed Drift 4 Life
Map: San Andreas
Guys none of these works!
Reply
#2

Using ZCMD

PHP код:
CMD:goto(playeridparams[]) 

    new 
ID
    new 
Str[64]; 
    if(
sscanf(params"u"ID)) SendClientMessage(playeridCOLOR_GREY"USAGE: /goto [playerid]"); 
    else if(
IsPlayerConnected(ID) == 0SendClientMessage(playeridCOLOR_GREY"Player is not connected!"); 
    new 
Float:xFloat:yFloat:z
    
GetPlayerPos(IDxyz); 
    
SetPlayerPos(playeridx+1y+1z); 
    return 
1

Reply
#3

It would help if you show us the code.

pawn Код:
command(goto, playerid, params[])
{
    new ID;
    if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xF97804FF, "USAGE: /goto [id]");
    else if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xF97804FF, "Player is not connected!");
    else
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(ID, x, y, z);
    SetPlayerPos(playerid, x+1, y+1, z);
    }
    return 1;
}
Rough example
Reply
#4

Past this OnGameModeInit
Quote:

if(strcmp( cmd, "/got", true ) == 0)
{
new tmp[256];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) { return 1; }

new Float:X, Float:Y, Float:Z;

if(GetPlayerVehicleID(playerid))
{
GetPlayerPos( strval(tmp), X, Y, Z );
SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z );
} else {
GetPlayerPos( strval(tmp), X, Y, Z );
SetPlayerPos( playerid, X+2, Y+2, Z );
}
return 1;
}

Reply
#5

Quote:
Originally Posted by Lhine.S
Посмотреть сообщение
Past this OnGameModeInit
Bro, learn to use some TABS.

pawn Код:
/-----[Goto]-----
CMD:goto(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "[CMD] /[PlayerID/PartOfName]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Player not connected!");
    else
    {
        new pName[24];
        GetPlayerName(targetid,pName,128);
        format(string, sizeof(string), "You succesfully teleported to [%d] %s.",targetid, pName);
        SendClientMessage(playerid,COLOR_RED,string);
        SetPlayerInterior(playerid,GetPlayerInterior(targetid));
        new Float:TPX, Float:TPY, Float:TPZ;
        GetPlayerPos(targetid, TPX, TPY, TPZ);
        SetPlayerPos(playerid, TPX, TPY, TPZ+1);
    }
    return 1;
}
Reply
#6

You forgot to add an ' / ' there Kingunit.
Reply
#7

Oh yeah I see, sorry:

pawn Код:
//-----[Goto]-----
CMD:goto(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "[CMD] /[PlayerID/PartOfName]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Player not connected!");
    else
    {
        new pName[24];
        GetPlayerName(targetid,pName,128);
        format(string, sizeof(string), "You succesfully teleported to [%d] %s.",targetid, pName);
        SendClientMessage(playerid,COLOR_RED,string);
        SetPlayerInterior(playerid,GetPlayerInterior(targetid));
        new Float:TPX, Float:TPY, Float:TPZ;
        GetPlayerPos(targetid, TPX, TPY, TPZ);
        SetPlayerPos(playerid, TPX, TPY, TPZ+1);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)