Bugged CMD
#6

try using a simple targetid variable
pawn Code:
CMD:goto(playerid, params[])
{
    new string[256],targetid;
    if ( sscanf( params, "u",targetid) )return SendClientMessage(playerid, COLOR_ORANGE, "You can use /pgoto <on/off> to disable enable people to come to you"),SendUsage( playerid, "/goto <id>" );
    if (P_DATA[targetid][ P_Goto ] == 0 && P_DATA[ playerid ][ P_Level ] < 1 )return format(string,sizeof( string ), "ERROR: %s has the goto turned off.", PlayerName2(targetid)),SendClientMessage(playerid, COLOR_RED, string );
    if(targetid == playerid )return SendError( playerid, "You cannot teleport to yourself!");
    new Float:ParamX, Float:ParamY, Float:ParamZ;

    GetPlayerPos(targetid, Float:ParamX, Float:ParamY, Float:ParamZ);
    SetCameraBehindPlayer( playerid );
    SetPlayerInterior( playerid, GetPlayerInterior(targetid));
    SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld(targetid) );
    if(GetPlayerState(playerid) == 2){
        SetVehiclePos( GetPlayerVehicleID( playerid ), ParamX+2, ParamY, ParamZ );
        LinkVehicleToInterior( GetPlayerVehicleID( playerid ), GetPlayerInterior(targetid));
        SetVehicleVirtualWorld( GetPlayerVehicleID( playerid ) , GetPlayerVirtualWorld(targetid));
    } else {
        SetPlayerPos( playerid, ParamX+2, ParamY, ParamZ );
    }

    FormMessageForAllEx(playerid && targetid,COLOR_GREEN, "%s teleported to %s!",PlayerName2( playerid ), PlayerName2( params[ 0 ] ));
    FormMessage( targetid, COLOR_GREEN, "%s teleported to you!",PlayerName2( playerid ) );
    FormMessage( playerid, COLOR_GREEN, "You teleported to %s!",PlayerName2(targetid) );

    return 1;
}
Reply


Messages In This Thread
Bugged CMD - by manchestera - 27.10.2011, 17:13
Re: Bugged CMD - by jonrb - 27.10.2011, 18:31
Re: Bugged CMD - by manchestera - 27.10.2011, 19:01
Re: Bugged CMD - by Wyu - 27.10.2011, 19:05
Re: Bugged CMD - by manchestera - 27.10.2011, 20:54
Re: Bugged CMD - by park4bmx - 27.10.2011, 21:02
Re: Bugged CMD - by manchestera - 28.10.2011, 19:54
Re: Bugged CMD - by manchestera - 28.10.2011, 20:12
Re: Bugged CMD - by FUNExtreme - 28.10.2011, 20:16
Re: Bugged CMD - by manchestera - 28.10.2011, 20:29

Forum Jump:


Users browsing this thread: 1 Guest(s)