#1

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;
} 
i got a bug.if i goto targetid the getplayername it show all the message.it suppose to be show the message (playername)but not show message (adminname) and message(playername)
at once .
Reply
#2

Can you show me those bugs
Reply
#3

you clearly put spaces everywhere. that is wrong. tell me if its better

PHP код:
CMD:tp(playerid, params[])
{ 
    if(
InDM[playerid] == true) return SendClientMessaeg(playerid,LIGHTORANGE,"[ERROR]You cant use commands while in a Deathmatch"); 
    new 
id; 
    if ( 
sscanf( params, "u", id ) ) 
            return 
SendClientMessage(playerid,-1,"Usage : /goto [id/name]"); 
    if (
bapakko[id] == false && !IsPlayerAdmin(playerid)) 
      return 
SendClientMessage(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); 
        
SendClientMessage(id, -1, string ); 
        
format(string,sizeof(string),"You teleported yourself to {FF4500}'%s'.", playerName); 
        
SendClientMessage(playerid,-1,string); 
    }
    else
    { 
        return 
SendClientMessage(playerid, -1,"Player is not connected."); 
    } 
    return 
1; 
} 
Reply
#4

not working
Reply
#5

Not understanding what your problem is.

Can you explain it further?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)