SA-MP Forums Archive
error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error (/showthread.php?tid=640772)



goto problem - asri - 07.09.2017

PHP код:
CMD:tp(playeridparams[]) {
    if(
InDM[playerid] == true) return scm(playerid,LIGHTORANGE,"[ERROR]You cant use commands while in a Deathmatch");
    new 
id;
    if ( 
sscanfparams"u"id ) )
            return 
scmplayerid, -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 ( 
IsPlayerConnectedid ) ) {
        new
            
adminName[MAX_PLAYER_NAME],
            
playerName[MAX_PLAYER_NAME],
            
string[64],
            
vehid,
            
Float:x,
            
Float:y,
            
Float:z
        
;
        
GetPlayerPosidxy);
        
GetPlayerNameplayeridadminNamesizeofadminName ) );
        
GetPlayerNameidplayerNamesizeofplayerName ) );
        
SetPlayerVirtualWorldplayeridGetPlayerVirtualWorldid ) );
        
SetPlayerInteriorplayeridGetPlayerInteriorid ) );
        if ( 
IsPlayerInAnyVehicleplayerid ) ) {
            
vehid GetPlayerVehicleIDplayerid );
            
SetVehiclePosvehid2y);
        } else {
            
SetPlayerPosplayerid2y);
        }
        
formatstringsizeof( string ), "{FF4500}'%s' {FFFFFF}has teleported to you."adminName );
        
scmid, -1string );
        
formatstringsizeof( string ), "You teleported yourself to {FF4500}'%s'."playerName );
        
scmplayerid, -1string );
    } else {
        return 
scmplayerid, -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 .


Re: error - n00blek - 07.09.2017

Can you show me those bugs


Re: error - n00blek - 07.09.2017

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

PHP код:
CMD:tp(playeridparams[])

    if(
InDM[playerid] == true) return SendClientMessaeg(playerid,LIGHTORANGE,"[ERROR]You cant use commands while in a Deathmatch"); 
    new 
id
    if ( 
sscanfparams"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 (
IsPlayerConnectedid ) )
    { 
        new 
            
adminName[MAX_PLAYER_NAME], 
            
playerName[MAX_PLAYER_NAME], 
            
string[64], 
            
vehid
            
Float:x
            
Float:y
            
Float:
        GetPlayerPos
(idxy); 
        
GetPlayerName(playeridadminNamesizeof(adminName) ); 
        
GetPlayerName(id,playerName,sizeof(playerName) ); 
        
SetPlayerVirtualWorldplayeridGetPlayerVirtualWorld(id) ); 
        
SetPlayerInterior(playeridGetPlayerInterior(id) ); 
        if (
IsPlayerInAnyVehicle(playerid) )
        { 
            
vehid GetPlayerVehicleIDplayerid ); 
            
SetVehiclePosvehid2y); 
        } 
        else 
        { 
            
SetPlayerPos(playerid2y); 
        } 
        
format(string,sizeof(string),"{FF4500}'%s' {FFFFFF}has teleported to you."adminName); 
        
SendClientMessage(id, -1string ); 
        
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




Re: error - asri - 08.09.2017

not working


Re: error - Kane - 08.09.2017

Not understanding what your problem is.

Can you explain it further?