05.04.2014, 12:53
Hi,
I made a function, but it returns `error 090: public functions may not return arrays (symbol "InsertState")`
My code:
Does anyone know the problem?
I made a function, but it returns `error 090: public functions may not return arrays (symbol "InsertState")`
My code:
Код:
public InsertState(playerid, reason) { new Username = GetPlayersRealId(playerid); new usersname[MAX_PLAYER_NAME]; GetPlayerName(playerid, usersname, sizeof(usersname)); new string[900]; new realreason[255]; switch(reason) { case 0: { realreason = "Has left"; } case 1: { realreason = "Has been kicked"; } case 2: { realreason = "Has joined"; } case 3: { realreason = "Has been banned"; } case 4: { realreason = "Has been killed"; } case 5: { realreason = "Has turned on the radio"; } } format(string, sizeof(string), "INSERT INTO `updates` (id, uid, reason, time) VALUES ('', '%s', '$s', UNIX_TIMESTAMP())", Username, realreason); mysql_query(string); new back[255]; format(back, sizeof(back), "StateUpdate for player %s: %s", usersname, realreason); return back; }