SA-MP Forums Archive
Error help (rep+) - 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: Error help (rep+) (/showthread.php?tid=593200)



Error help (rep+) - OMonger - 02.11.2015

I get this error:
PHP код:
C:\Users\\Desktop\games\samp scripts\Roleplay (0.3.7)\gamemodes\roleplay.pwn(1216) : error 033: array must be indexed (variable "name"
For this line:
PHP код:
if(HouseInfo[id][hOwner] == name
This is the hOwner enum:
PHP код:
    hOwner[MAX_PLAYER_NAME], 
And finally this is the getplayername stuff:
PHP код:
            GetPlayerName(playeridnamesizeof(name)); 
Help please.


Re: Error help (rep+) - AbyssMorgan - 02.11.2015

PHP код:
if(strcmp(HouseInfo[id][hOwner],name,true) != 0



Re: Error help (rep+) - prineside - 02.11.2015

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
if(strcmp(HouseInfo[id][hOwner],name,true) != 0
+1 for the reply, but let me explain for others why thhat didn't work.

Strings can't be easily compared in PAWN, you can only compare them char-by-char or use strcmp() / other function, which does the same thing.

(Give +rep to AbyssMorgan, not me. I'm just spamming for clearness)


Re: Error help (rep+) - OMonger - 02.11.2015

thanks.