07.09.2011, 00:07
Ok im making a new ban system for my server and i came on a problem that just pissing me off!
Long time i didnt ask for help here so its about a time :P
here is the problem:
I use mysql for ban system and i get every field right (debugged with printf )
Its print everything as it is in database
But now when i need to format it to dialog its just get bugged on "Reason"
Its show me in dialog Reason: and nothing behind it (even printf says Test and in database is test)
here is code and it looks fine to me...
As you can see i commented that ? switch after reason thats also to debug script so with or without it its same
Anyone have idea why is these happens ? Its only on Reason everything else is fine...
Long time i didnt ask for help here so its about a time :P
here is the problem:
I use mysql for ban system and i get every field right (debugged with printf )
Its print everything as it is in database
But now when i need to format it to dialog its just get bugged on "Reason"
Its show me in dialog Reason: and nothing behind it (even printf says Test and in database is test)
here is code and it looks fine to me...
As you can see i commented that ? switch after reason thats also to debug script so with or without it its same
pawn Код:
while(mysql_fetch_row(Query))//These will loop untill server dont get all fields
{
mysql_fetch_field_row(UserName,"UserName");
mysql_fetch_field_row(AdminName,"AdminName");
mysql_fetch_field_row(IP,"IP");
mysql_fetch_field_row(BanReason,"Reason");
printf("Reason: %s",BanReason);
mysql_fetch_field_row(BanType,"Type");//Dont forget to stval it !!!
mysql_fetch_field_row(BanTime,"BanTime");
mysql_fetch_field_row(BanUntil,"BanUntil");
new String[300];
format(String,sizeof(String),"User name: %s\n\
Admin name: %s\n\
IP: %s\n\
Reason: %s\n\
Type: %d\n\
Baned: %s\n\
Until: %s\n\
You can complain at\n\
www.driftersparadise.co.cc",UserName,
AdminName,
IP,
BanReason,
BanType,// ? ("Temporary") : ("Dynamic"),
BanTime,
BanUntil);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,embed_red"Banned", String,"Ok","");
}