Loose intendation?
#1

PHP код:
YCMD:respawn(playerid,params[], help)
{
    new 
id,string[256];
    if(
PlayerData[playerid][Admin] < 3) return SendClientMessage(playeridCOLOR_WHITEAdminOnly);
    if(
sscanf(params"u"id)) return SendUsage(playerid,"/respawn <Name/Playerid>");
    if(
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_WHITE"{FFFFCC}Error: Player not connected.");
    
SpawnPlayer(id);
    
format(stringsizeof(string), "* You have respawned player %s"PlayerData[id][Name]);
    
SendClientMessage(playeridCOLOR_YELLOW2string);
    
format(stringsizeof(string), "* You have been respawned by Admin %s"PlayerData[playerid][Name]);
    
SendClientMessage(idCOLOR_LIGHTREDstring);
        
format(stringsizeof(string), "{F81414}AdmWarning:{FFFFFF} %s has respawned player %s !"PlayerData[playerid][Name], PlayerData[id][Name]);
        
ABroadCast(COLOR_WHITE,string,1);
    return 
1;

why do i get loose intendation on these lines
PHP код:
        format(stringsizeof(string), "{F81414}AdmWarning:{FFFFFF} %s has respawned player %s !"PlayerData[playerid][Name], PlayerData[id][Name]);
        
ABroadCast(COLOR_WHITE,string,1);
    return 
1
in sublime text 3 it looks normal :https://imgur.com/A9vno3v
Reply
#2

Cause your code needs to be inline with the others.

PHP код:
YCMD:respawn(playerid,params[], help

    new 
id,string[256]; 
    if(
PlayerData[playerid][Admin] < 3) return SendClientMessage(playeridCOLOR_WHITEAdminOnly); 
    if(
sscanf(params"u"id)) return SendUsage(playerid,"/respawn <Name/Playerid>"); 
    if(
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_WHITE"{FFFFCC}Error: Player not connected."); 
    
SpawnPlayer(id); 
    
format(stringsizeof(string), "* You have respawned player %s"PlayerData[id][Name]); 
    
SendClientMessage(playeridCOLOR_YELLOW2string); 
    
format(stringsizeof(string), "* You have been respawned by Admin %s"PlayerData[playerid][Name]); 
    
SendClientMessage(idCOLOR_LIGHTREDstring); 
    
format(stringsizeof(string), "{F81414}AdmWarning:{FFFFFF} %s has respawned player %s !"PlayerData[playerid][Name], PlayerData[id][Name]); 
    
ABroadCast(COLOR_WHITE,string,1); 
    return 
1

Reply
#3

i know im not that dumb,but look in the picture i gave you.

it looks perfect in sublime text 3
Reply
#4

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
I know I'm not that dumb, but look at the picture I gave you.

it looks perfect in sublime text 3
Oh.

I never said you were though.


It could be something above the actual warning check a few lines up and see.
Reply
#5

It could be two things:

1. You are using spaces somewhere and tabs elsewhere
2. Tabsize is set incorrectly in the editor causing a certain amount of spaces to seem like a wrongly numbered amount of tabs

Also, check that you don't have a "#pragma tabsize x" defined anywhere. I am pretty sure default is 4.
Reply
#6

how can i solve that?

i dont have any pragma tabsize defined.

when i select it it looks like that https://imgur.com/ghCU0IP
Reply
#7

use tabs in sublime, instead of spaces.
Reply
#8

Quote:
Originally Posted by Mugalito
Посмотреть сообщение
use tabs in sublime, instead of spaces.

i tried,still didnt work.
Reply
#9

Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
i tried,still didnt work.
which one you tried?
Reply
#10

second one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)