16.10.2011, 21:05
Hello. I'm working on a function for my server, however I always get an error, telling me I can't return a string in a public function. I tried to put the string into strlen(), which showed no result at all, so I'm asking for a help here.
Thanks!
The errors are:
Thanks!
Код:
public OnPlayerText(playerid, text[]) { new string[160], pName[32]; GetPlayerName(playerid, pName, sizeof(pName)); if(GetPVarInt(playerid, "Infected") == 1) { format(string, sizeof(string), "[Person %d]: %s", GetNumber(pName), text); return string; } else return 1; }
Код:
C:\Users\Viktor\Desktop\lol.pwn(18) : error 090: public functions may not return arrays (symbol "OnPlayerText") C:\Users\Viktor\Desktop\lol.pwn(20) : error 079: inconsistent return types (array & non-array)