I suck at indenting! D:
#1

Fixed
Reply
#2

http://dracoblue.net/tidy/pawn/

also not trying to be mean, but thats like the worst code I've ever seen.
Reply
#3

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
No, I need the brackets fixed.
Reply
#4

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
No, I need the brackets fixed.
You said

"Can someone fix my indenting so it actually compiles without me getting pwned with errors?"

Where does it say brackets?
Reply
#5

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
You said

"Can someone fix my indenting so it actually compiles without me getting pwned with errors?"

Where does it say brackets?
Sorry i wrote it wrong. Post updated
Reply
#6

your script is really fucked up, and would take too long to fix.. would be easier to redo it, and use an array for your cars instead of shockey3, shockey4, etc ... you could have MyCars[5] .. then just loop through them
Reply
#7

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
your script is really fucked up, and would take too long to fix.. would be easier to redo it, and use an array for your cars instead of shockey3, shockey4, etc ... you could have MyCars[5] .. then just loop through them
where would i define them? Little help?
Reply
#8

pawn Код:
new MyCars[5];
//Example
public OnGameModeInit()
{
    MyCars[0] = CreateVehicle;
    MyCars[1] = CreateVehicle;
    Etc
   
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        for(new i = 0; i < sizeof(MyCars); i++)
        {
            if(vid == MyCars[i])
            {
                if(strcmp(name, "YourName", true))
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, -1, "Only YourName can enter this car!");
                    return 1;
                }
            }
        }
    }
    return 1;
}
That should work, untested though.

Keep in mind its an example though, like no cars are being created
Reply
#9

So according to what dr. pepper posted, for every two opening brackets, you had one closing bracket and another opening bracket. properly indent and you will find these mistakes, also the optimization is a bit off :/. try notepad++ for coding, slice has a tutorial on how to set everything up, it makes the indenting easier.
Reply
#10

Okay so this is what i fully got.

PHP код:
new MyCars[10]; 
PHP код:
    MyCars[0] = CreateVehicle(411,669.92089844,-1287.35229492,13.26093769,0.00000000,3,-1,15); //Infernus
    
MyCars[1] = CreateVehicle(451,659.35235596,-1287.35229492,13.39718437,0.00000000,3,1,15); //Turismo
    
MyCars[2] = CreateVehicle(506,669.86907959,-1293.91162109,13.25305080,0.00000000,3,3,15); //Super GT
    
MyCars[3] = CreateVehicle(541,669.92382812,-1300.25195312,13.16093731,0.00000000,3,-1,15); //Bullet
    
MyCars[4] = CreateVehicle(477,659.29956055,-1293.91162109,13.48281288,0.00000000,3,1,15); //ZR-350
    
MyCars[5] = CreateVehicle(429,659.50573730,-1300.25195312,13.38281250,0.00000000,3,-1,15); //Banshee
    
MyCars[6] = CreateVehicle(522,671.70117188,-1266.75109863,13.28537750,90.00000000,3,-1,15); //NRG-500
    
MyCars[7] = CreateVehicle(522,671.52056885,-1268.26049805,13.28537750,90.00000000,3,-1,15); //NRG-500
    
MyCars[8] = CreateVehicle(522,671.58276367,-1269.75903320,13.28537750,90.00000000,3,-1,15); //NRG-500
    
MyCars[9] = CreateVehicle(487,680.26483154,-1261.22985840,13.85198498,0.00000000,3,-1,15); //Maverick 
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        new 
vid GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        for(new 
0sizeof(MyCars); i++)
        {
            if(
vid == MyCars[i])
            {
                if(
strcmp(name"[SD]Shockey HD"true))
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SendClientMessage(playerid, -1"You are not Shockey!");
                    return 
1;
                }
            }
        }
    }
    return 
1;

Reply
#11

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
Okay so this is what i fully got.

PHP код:
new MyCars[10]; 
PHP код:
    MyCars[0] = CreateVehicle(411,669.92089844,-1287.35229492,13.26093769,0.00000000,3,-1,15); //Infernus
    
MyCars[1] = CreateVehicle(451,659.35235596,-1287.35229492,13.39718437,0.00000000,3,1,15); //Turismo
    
MyCars[2] = CreateVehicle(506,669.86907959,-1293.91162109,13.25305080,0.00000000,3,3,15); //Super GT
    
MyCars[3] = CreateVehicle(541,669.92382812,-1300.25195312,13.16093731,0.00000000,3,-1,15); //Bullet
    
MyCars[4] = CreateVehicle(477,659.29956055,-1293.91162109,13.48281288,0.00000000,3,1,15); //ZR-350
    
MyCars[5] = CreateVehicle(429,659.50573730,-1300.25195312,13.38281250,0.00000000,3,-1,15); //Banshee
    
MyCars[6] = CreateVehicle(522,671.70117188,-1266.75109863,13.28537750,90.00000000,3,-1,15); //NRG-500
    
MyCars[7] = CreateVehicle(522,671.52056885,-1268.26049805,13.28537750,90.00000000,3,-1,15); //NRG-500
    
MyCars[8] = CreateVehicle(522,671.58276367,-1269.75903320,13.28537750,90.00000000,3,-1,15); //NRG-500
    
MyCars[9] = CreateVehicle(487,680.26483154,-1261.22985840,13.85198498,0.00000000,3,-1,15); //Maverick 
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        new 
vid GetPlayerVehicleID(playerid), name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        for(new 
0sizeof(MyCars); i++)
        {
            if(
vid == MyCars[i])
            {
                if(
strcmp(name"[SD]Shockey HD"true))
                {
                    
RemovePlayerFromVehicle(playerid);
                    
SendClientMessage(playerid, -1"You are not Shockey!");
                    return 
1;
                }
            }
        }
    }
    return 
1;

Oh Thank God
XD
Reply
#12

Quote:
Originally Posted by dowster
Посмотреть сообщение
Oh Thank God
XD
I like your signature...
Reply
#13

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
I like your signature...
lol, i thought it was worthy to replace my horribly designed GIF and the link to my horrible player, vehicle, house filterscript lol
Reply
#14

Quote:
Originally Posted by dowster
Посмотреть сообщение
lol, i thought it was worthy to replace my horribly designed GIF and the link to my horrible player, vehicle, house filterscript lol
Whoever that shockey guy is, he sure sounds like a hunk
Reply
#15

Quote:
Originally Posted by Shockey HD
Посмотреть сообщение
Whoever that shockey guy is, he sure sounds like a hunk
wouldn't know
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)