23.09.2014, 15:12
So is there anyway I could make this work?
I'm sure I'm doing something wrong here, because I feel like something like this could be possible. Anyway the errors it's giving me are these:
Код:
stock GetDrugID (drugname[32]) { new drugid; if(drugname == "weed") { drugid = 1; return drugid; } else if(drugname == "shrooms") { drugid = 2; return drugid; } else if(drugname == "heroin") { drugid = 3; return drugid; } else if(drugname == "lsd") { drugid = 4; return drugid; } else if(drugname == "meth") { drugid = 5; return drugid; } return 1; }
Код:
sarp.pwn(12352) : error 033: array must be indexed (variable "drugname") sarp.pwn(12357) : error 033: array must be indexed (variable "drugname") sarp.pwn(12362) : error 033: array must be indexed (variable "drugname") sarp.pwn(12367) : error 033: array must be indexed (variable "drugname") sarp.pwn(12372) : error 033: array must be indexed (variable "drugname")