zcmd xgoto +rep
#1

Can somone tell me how to make to teleport on cords /xgoto z x like that ..
example /xgoto 2350.339843 -1181.649902 1027.976562
Reply
#2

pawn Код:
COMMAND:gotoco(playerid, params[])
{
    new Float:x, Float:y,  Float:z;
    if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, -1, "(USAGE) /xogotoco[x][y][z]");
    SetPlayerPos(playerid, x,y,z);
    return 1;
}
You using sscanf? Thats what I used for the params to check if the player has entered the correct details.

EDIT: I've fixed the code; Should all work now.
Reply
#3

@Death1300 : You forgot a params, you put only 3. "fff" - x, y, z. and where's of world?


pawn Код:
CMD:gotoco(playerid, params[])
{
    new string[300], Float:x, Float:y,  Float:z, interior, world;
    if(sscanf(params, "fffd", x, y, z, interior, world)) return SendClientMessage(playerid, -1, "(USAGE) /xogotoco[x][y][z]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerVirtualWorld(playerid, world);
    return 1;
}
Reply
#4

I'm using zcmd ..

Thanks you both i +rep you both
Reply
#5

Fixed version of Death1300's solution:

pawn Код:
CMD:xgoto(playerid, params[])
{
    new
        string[300],
        Float:x,
        Float:y,
        Float:z,
        interiorid;
    if(sscanf(params, "fffD(0)", x, y, z, interiorid)) return SendClientMessage(playerid, -1, "(USAGE) /xgoto[x][y][z] <Interior ID>");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, interiorid);
    return 1;
}
Reply
#6

You only using zcmd? I've pusmed that you had sscanf too?

Edit: I apologize for the mistakes I made in the code. I just copied it from my script that I'm currently making (from scratch) but its all fixed now
Reply
#7

Ty all +rep ..
Reply
#8

Quote:
Originally Posted by iFarbod
Посмотреть сообщение
Fixed version of Death1300's solution:

pawn Код:
CMD:xgoto(playerid, params[])
{
    new
        string[300],
        Float:x,
        Float:y,
        Float:z,
        interiorid;
    if(sscanf(params, "fffD(0)", x, y, z, interiorid)) return SendClientMessage(playerid, -1, "(USAGE) /xgoto[x][y][z] <Interior ID>");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, interiorid);
    return 1;
}
Useless string, you don't do anything with it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)