Some error and I don't understand how to fix
#1

Hey, I wrote script and when I compiled I haved that errors:
Код:
warning 202: number of arguments does not match definition
error 033: array must be indexed (variable "aNick")
warning 202: number of arguments does not match definition
error 033: array must be indexed (variable "Date")
warning 202: number of arguments does not match definition
error 033: array must be indexed (variable "Reason")
warning 202: number of arguments does not match definition
error 033: array must be indexed (variable "IP")
code:

Код:
if(Player[ playerid ][ pBanned ] == 1)
			{
				inline baninfo(pid)
				{
					#pragma unused pid
					new aNick[ 24 ], Date[ 40 ], Reason[ 100 ], Expire, IP[ 17 ]; 
					aNick = cache_get_field_content(0, "aNick"); //527
					Date = cache_get_field_content(0, "Date");
					Reason = cache_get_field_content(0, "Reason");
					Expire = cache_get_field_content_int(0,"Expire");
					IP = cache_get_field_content(0, "IP");//531

					new likoiki = (gettime() - Expire)/U_MINUTE;
					new table[ 24 + 40 + 100 + 17 + 200 ];
					format(table,sizeof(table),"Jūs esate uћblokuotas %s|\n\
								    Įvykio data \t\t\t %s\n\
								    Prieћastis: %s\n\
								    Iki atblokavimo liko %d minučių", aNick, Date, Reason, likoiki );
					new id = Dialog_Show(playerid, DIALOG_STYLE_MSGBOX, "Tu uћblokuotas", table, "Gerai","");
					_Kick(playerid);
				}
				new query[ 100 ];
				GetPlayerName(playerid, Player[ playerid ][ pNick ], MAX_PLAYER_NAME);
				mysql_format(SQL,query,sizeof(query),"SELECT * FROM baned WHERE Nick = '%s' ", Player[ playerid ][ pNick ]);
				mysql_tquery_inline(SQL, query, using inline baninfo, "i", playerid);
				return 1;
			}
I've searched anywhere, but I don't find the solve for this errors.
Sorry for bad English.
Reply
#2

You're not using all the parameters. It should be something like this:

pawn Код:
cache_get_field_content(0, "aNick", aNick); //527
cache_get_field_content(0, "Date", Date);
cache_get_field_content(0, "Reason", Reason);
cache_get_field_content_int(0,"Expire", Expire);
cache_get_field_content(0, "IP", IP);//531
Reply
#3

Cache operations with string use a parameter to determine where to store the result at. They don't return any specific value.

Int and float operations with the cache do return a parameter and you can and should do
Код:
Expire = cache_get_field_content_int(0,"Expire");
While this would be incorrect (the last post)
Код:
cache_get_field_content_int(0,"Expire", Expire);
Reply
#4

Thx for all!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)