Command Help
#7

pawn Код:
if ( strcmp( cmd, "/goto", true ) == 0 )
{
    new pID = strval(tmp);
    if(!strlen(cmdtext)) return SendClientMessage(playerid, 0xFF0000AA, "/Goto [playerid]");
    if(AllowGoto[pID] == 0) return SendClientMessage(playerid, COLOR_RED, "This player has disable teleport");
    if( pID == playerid ) return SendClientMessage(playerid, COLOR_RED, "You cannot goto yourself");
    if( !IsPlayerConnected( pID ) && pID == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player is not connected!" );

    new tmp[256];
    tmp = strtok( cmdtext, idx );
    if ( !strlen( tmp ) ) { return 1; }
    new Float:X, Float:Y, Float:Z, Pname[24];
    GetPlayerPos( pID, X, Y, Z );
    ResetPlayerWeapons(playerid);
    if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z );
    else SetPlayerPos( playerid, X+2, Y+2, Z );
    new String[56];
    GetPlayerName(pID, Pname, sizeof(Pname));
    format(String, sizeof(String), "{FF9600}You have teleported to %s(%d)", Pname, pID);
    SendClientMessage(playerid, COLOR_ORANGE, String);
    GetPlayerName(playerid, Pname, sizeof(Pname));
    format(String, sizeof(String), "{FF9600}%s(%d) has teleported to your location", Pname, playerid);
    SendClientMessage(pID, COLOR_ORANGE, String);

    return 1;
}
Try this...
Reply


Messages In This Thread
Command Help - by Kostas' - 21.10.2011, 16:30
Re: Command Help - by aRoach - 21.10.2011, 16:35
Re: Command Help - by Kostas' - 21.10.2011, 16:40
Re: Command Help - by TouR - 21.10.2011, 16:41
Re: Command Help - by Kostas' - 21.10.2011, 16:44
Re: Command Help - by [MWR]Blood - 21.10.2011, 16:53
Re: Command Help - by aRoach - 21.10.2011, 16:58
Re: Command Help - by Kostas' - 21.10.2011, 17:10

Forum Jump:


Users browsing this thread: 1 Guest(s)