07.09.2017, 02:19
(
Последний раз редактировалось asri; 07.09.2017 в 03:03.
)
PHP код:
CMD:tp(playerid, params[]) {
if(InDM[playerid] == true) return scm(playerid,LIGHTORANGE,"[ERROR]You cant use commands while in a Deathmatch");
new id;
if ( sscanf( params, "u", id ) )
return scm( playerid, -1, "Usage : /goto [id/name]" );
if (bapakko[id] == false && !IsPlayerAdmin(playerid))
return scm(playerid, -1, "This player has teleporting turned off.");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"{FA002E}ERROR: {C7BDBF}Invalid player ID!");
if ( IsPlayerConnected( id ) ) {
new
adminName[MAX_PLAYER_NAME],
playerName[MAX_PLAYER_NAME],
string[64],
vehid,
Float:x,
Float:y,
Float:z
;
GetPlayerPos( id, x, y, z );
GetPlayerName( playerid, adminName, sizeof( adminName ) );
GetPlayerName( id, playerName, sizeof( playerName ) );
SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld( id ) );
SetPlayerInterior( playerid, GetPlayerInterior( id ) );
if ( IsPlayerInAnyVehicle( playerid ) ) {
vehid = GetPlayerVehicleID( playerid );
SetVehiclePos( vehid, x + 2, y, z );
} else {
SetPlayerPos( playerid, x + 2, y, z );
}
format( string, sizeof( string ), "{FF4500}'%s' {FFFFFF}has teleported to you.", adminName );
scm( id, -1, string );
format( string, sizeof( string ), "You teleported yourself to {FF4500}'%s'.", playerName );
scm( playerid, -1, string );
} else {
return scm( playerid, -1, "Player is not connected." );
}
return 1;
}
at once .