#5

pawn Код:
CMD:gethere(playerid, params[])
{
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");


    new str[128]; format(str, sizeof(str), "giveplayerid = %d", giveplayerid), SendClientMessage(playerid, -1, str);//For debugging, remove if worked

   
    if (!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
    if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
    if (PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING) return SendClientMessageEx(playerid, COLOR_GRAD2, "That player is spectating someone.");

    new Float:plocx,Float:plocy,Float:plocz;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
    SetPVarInt(playerid, "BeingTeleported", 1);
    SetPlayerVirtualWorld(giveplayerid, PlayerInfo[playerid][pVW]);

    PlayerInfo[giveplayerid][pLocal] = PlayerInfo[playerid][pLocal];

    if (GetPlayerState(giveplayerid) == 2)
    {
        TelePos[giveplayerid][0] = 0.0;
        TelePos[giveplayerid][1] = 0.0;
        new tmpcar = GetPlayerVehicleID(giveplayerid);
        SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
        LinkVehicleToInterior(GetPlayerVehicleID(giveplayerid), GetPlayerInterior(playerid));
        SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(GetPlayerVehicleID(giveplayerid), GetPlayerVirtualWorld(playerid));
        SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
    }
    else
    {
        SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
        SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
        SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
    }

    return SendClientMessageEx(giveplayerid, COLOR_GRAD1, "You have been teleported!");
}
I added a debug to show you which "playerid" you typed.
Reply


Messages In This Thread
Help - by NayanIndia - 15.01.2015, 10:24
Re: Help - by ATGOggy - 15.01.2015, 10:26
Re: Help - by NayanIndia - 15.01.2015, 10:28
Re: Help - by NayanIndia - 15.01.2015, 10:32
Re: Help - by xVIP3Rx - 15.01.2015, 10:34
Re: Help - by NayanIndia - 15.01.2015, 10:36
Re: Help - by ATGOggy - 15.01.2015, 10:39
Re: Help - by Thoma - 15.01.2015, 10:39
Re: Help - by xVIP3Rx - 15.01.2015, 10:39
Re: Help - by NayanIndia - 15.01.2015, 10:40
Re: Help - by NayanIndia - 15.01.2015, 10:43
Re: Help - by NayanIndia - 15.01.2015, 10:45
Re: Help - by ATGOggy - 15.01.2015, 10:49
Re: Help - by NayanIndia - 15.01.2015, 10:52

Forum Jump:


Users browsing this thread: 3 Guest(s)