I suck at indenting! D: -
Shockey HD - 28.07.2011
Fixed
Re: I suck at indenting! D: -
PrawkC - 28.07.2011
http://dracoblue.net/tidy/pawn/
also not trying to be mean, but thats like the worst code I've ever seen.
Re: I suck at indenting! D: -
Shockey HD - 28.07.2011
Quote:
Originally Posted by PrawkC
|
No, I need the brackets fixed.
Re: I suck at indenting! D: -
PrawkC - 28.07.2011
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?
Re: I suck at indenting! D: -
Shockey HD - 28.07.2011
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
Re: I suck at indenting! D: -
PrawkC - 28.07.2011
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
Re: I suck at indenting! D: -
Shockey HD - 28.07.2011
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?
Re: I suck at indenting! D: -
PrawkC - 28.07.2011
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
Re: I suck at indenting! D: -
dowster - 28.07.2011
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.
Re: I suck at indenting! D: -
Shockey HD - 28.07.2011
Okay so this is what i fully got.
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(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, "[SD]Shockey HD", true))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "You are not Shockey!");
return 1;
}
}
}
}
return 1;
}
Re: I suck at indenting! D: -
dowster - 28.07.2011
Quote:
Originally Posted by Shockey HD
Okay so this is what i fully got.
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(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, "[SD]Shockey HD", true))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, -1, "You are not Shockey!");
return 1;
}
}
}
}
return 1;
}
|
Oh Thank God
XD
Re: I suck at indenting! D: -
Shockey HD - 28.07.2011
Quote:
Originally Posted by dowster
Oh Thank God
XD
|
I like your signature...
Re: I suck at indenting! D: -
dowster - 28.07.2011
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
Re: I suck at indenting! D: -
Shockey HD - 28.07.2011
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
Re: I suck at indenting! D: -
dowster - 28.07.2011
Quote:
Originally Posted by Shockey HD
Whoever that shockey guy is, he sure sounds like a hunk
|
wouldn't know