SA-MP Forums Archive
Could use a bit of help... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Could use a bit of help... (/showthread.php?tid=256797)



Could use a bit of help... - DeadAhead - 22.05.2011

Ok. So this is what i need to do, and wonder if its possible.

Код:
new LongString[MAX_PLAYER][255]; // Yes i know 255, its a example so shut up xD
if (LongString[playerid]["blabla"] = 1) BAN BAN BAN;
This is just an example. But you should get where im going at. Is this possible with Enums/NormalVars/Something? If not with Vars, maybe PVars?


Re: Could use a bit of help... - DeathOnaStick - 22.05.2011

Quote:
Originally Posted by DeadAhead
Посмотреть сообщение
Ok. So this is what i need to do, and wonder if its possible.

Код:
new LongString[MAX_PLAYER][255]; // Yes i know 255, its a example so shut up xD
if (LongString[playerid]["blabla"] = 1) BAN BAN BAN;
This is just an example. But you should get where im going at. Is this possible with Enums/NormalVars/Something? If not with Vars, maybe PVars?
Sure it's possible but I think you would need another dimension in your array (or you use smth that ****** released, I think he made some plugin you could use). I'd do it like this:
pawn Код:
new LongString[MAX_PLAYER][255][255]; // Blablabla, adding another dimension, so the string can be stored.
if (strcmp(LongString[playerid][0], "Blabla")==0&&LongString[playerid][somevar which is not 0][somevar]==1) BAN BAN BAN;
Do you understand how I'd do it or do i need to explain it?


Re: Could use a bit of help... - DeadAhead - 27.05.2011

Of course i understand, and thank you. But this was not exactly what i was hoping for. I was hoping for a way to Use Characters as keys instead of Numbers. Like lua has that neat function. But i understand that is not possible. Thanks for the reply anyways :0