problem with goto
#1

im using sscanf + zcmd and when i do /goto it says unknown cmd, SCRIPT!
pawn Код:
COMMAND:goto(playerid, params[])
{
    if(PlayerData[playerid][IsAdmin])
    {
        new id, Float: Pos[3];
        if(sscanf(params, "ui", id)) return SendClientMessage(playerid, 0xFF9900AA, "USAGE: /goto [id]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected.");
        SendClientMessage(playerid, 0xFF9900AA, "You have teleported to that player!");
        SendClientMessage(id, 0xFF9900AA, "An admin has teleported to you!");
        return
        GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

    }
    else return SendClientMessage(playerid,0xFF0000FF, "ERROR: You admin level isn't high enough!");
}
Reply
#2

pawn Код:
COMMAND:goto(playerid, params[])
{
    if(PlayerData[playerid][IsAdmin])
    {
        new id, Float:Pos[3];
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF9900AA, "USAGE: /goto [id]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected.");
        SendClientMessage(playerid, 0xFF9900AA, "You have teleported to that player!");
        SendClientMessage(id, 0xFF9900AA, "An admin has teleported to you!");
        GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
    }
    else return SendClientMessage(playerid,0xFF0000FF, "ERROR: You admin level isn't high enough!");
}
Reply
#3

Your error was simply a easy fix. It's called not paying attention and trying to rush everything to get done..
Reply
#4

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Your error was simply a easy fix. It's called not paying attention and trying to rush everything to get done..
Bro, stop trollin'.
Reply
#5

thanks again antonio
Reply
#6

how i make if the player in car and i do /get, they teleport to me with their vehicle?
Reply
#7

First provide us with your /get command
Reply
#8

pawn Код:
COMMAND:get(playerid, params[])
{
    if(PlayerData[playerid][IsAdmin])
    {
        new id, Float:Pos[3];
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF9900AA, "USAGE: /get [id]");
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected.");
        SendClientMessage(playerid, 0xFF9900AA, "You have teleported that player to you!");
        SendClientMessage(id, 0xFF9900AA, "An admin has teleported you to him!");
        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        SetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
    }
    else return SendClientMessage(playerid,0xFF0000FF, "ERROR: You admin level isn't high enough!");
    return 1;
}
;| (got my eyes on you)
Reply
#9

This might help...

pawn Код:
COMMAND:get(playerid, params[])
{
    new id, Float:Pos[3];
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /get [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "ERROR: That player isn't connected.");
    if(PlayerData[playerid][IsAdmin])
    {
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        new int = GetPlayerInterior(playerid);
        if(GetPlayerState(id) == PLAYER_STATE_ONFOOT)
        {
            SetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
            SetPlayerInterior(id, int);
        }
        if(IsPlayerInAnyVehicle(id) && GetPlayerState(id) == PLAYER_STATE_DRIVER)
        {
            new veh = GetPlayerVehicleID(id);
            new interior = GetPlayerInterior(playerid);
            SetVehiclePos(veh, x+5, y, z);
            SetPlayerInterior(id, interior);
            PutPlayerInVehicle(id, veh, 0);
        }
        SendClientMessage(playerid, -1, "You've teleported a player.");
        SendClientMessage(id, -1, "You've been teleported.");
    }
    else {
        SendClientMessage(playerid, -1, "You aren't admin!");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)