SA-MP Forums Archive
Confused - 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: Confused (/showthread.php?tid=342114)



Confused - Mimic - 12.05.2012

EDIT: Fixed


Re: Confused - HDFord - 12.05.2012

you cannot use the word "string" do like this.
pawn Код:
new minutes, userid, reason[64], string1[128];



Re: Confused - MP2 - 12.05.2012

lrn2indent


Re: Confused - Mimic - 12.05.2012

I've been able to use just
Код:
string[128];
in previous codes, or is it just regarding this command?


Re: Confused - Vince - 12.05.2012

Just by looking at how your code is highlighted in your post, you should be able to figure out your mistake.

pawn Код:
return SendClientMessage(playerid,COLOR_GREY,"USAGE: \"/ajail [playerid][minutes][reason]/"");
That last forward slash needs to be a backslash.


Re: Confused - ReneG - 12.05.2012

da faq is up with this line?
pawn Код:
if(AdminPerm[PlayerInfo[playerid][pAdministrator]][General] == 0) >=if(AdminPerm[PlayerInfo[userid][pAdministrator]][General] == 0) {



Re: Confused - Face9000 - 12.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
lrn2indent
Learn to help people instead of making this useless posts.

The mistake is at this line:

pawn Код:
return SendClientMessage(playerid,COLOR_GREY,"USAGE: \"/ajail [playerid][minutes][reason]/"");
Change it to:

pawn Код:
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ajail [playerid] [minutes] [reason]");



Re: Confused - Mimic - 12.05.2012

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
da faq is up with this line?
pawn Код:
if(AdminPerm[PlayerInfo[playerid][pAdministrator]][General] == 0) >=if(AdminPerm[PlayerInfo[userid][pAdministrator]][General] == 0) {
haha, think I was copying and pasting to make things easier, must of ctrl + c & ctrl + v more than once, my bad.

EDIT:

Quote:
pawn Код:
return SendClientMessage(playerid,COLOR_GREY,"USAGE: \"/ajail [playerid][minutes][reason]/"");
Change it to:

pawn Код:
return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ajail [playerid] [minutes] [reason]");
Thanks, I figured the problem out, thanks for all the comments.


Re: Confused - MP2 - 13.05.2012

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Learn to help people instead of making this useless posts.
It is not a useless post. Indentation is important as it allows clearer readability of the code, which helps when you come back 3 months later and are presented with

pawn Код:
if() {}+{}}{{}
{}}{}{
stuff(   params   ); {
}}
{}}
Who ever came up with the whole 'bracket on same line as if()' is an idiot.


Re: Confused - Vince - 13.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
Who ever came up with the whole 'bracket on same line as if()' is an idiot.
That's actually quite a common practice, see here: http://en.wikipedia.org/wiki/Indent_style . I prefer the Allman style, though.