21.02.2013, 17:11
So I'm just testing some things what I can do with global variables and I'm stuck with something.
The problem is my code bugs after the global variable (string) is set to something.
This is my code.
Under OnPlayerConnect I set them to "", but it doesn't execute. Everything after this won't be executed either. (Eg. I have VMessages & then SetPlayerColor, it just stops at VMessages and doesn't set the player's color)
And I'm scripting a voicemail thingy atm so I tried todo this:
but the problem is it bugs when there are 2 voicemail messages written. Any ideas on how to fix this? It has something todo with the VMessages I suppose (As it blocks all the other codes under OnPlayerText)
EDIT: ohye, it compiles with no errors.
The problem is my code bugs after the global variable (string) is set to something.
This is my code.
pawn Код:
new VMessages[][MAX_PLAYERS][5];
pawn Код:
for(new i = 0; i < 6; i++)
{
VMessages[playerid][i] = "";
}
pawn Код:
WrittenMessages[pID]++;
if(WrittenMessages[pID] == 6) { WrittenMessages[pID] = 0; strmid(VMessages[pID][0], msg, 0, strlen(msg), 255); VCaller[pID][0] = playerid; }
else if(WrittenMessages[pID] == 1) { strmid(VMessages[pID][0], msg, 0, strlen(msg), 255); VCaller[pID][0] = playerid; }
else if(WrittenMessages[pID] == 2) { strmid(VMessages[pID][1], msg, 0, strlen(msg), 255); VCaller[pID][1] = playerid; }
else if(WrittenMessages[pID] == 3) { strmid(VMessages[pID][2], msg, 0, strlen(msg), 255); VCaller[pID][2] = playerid; }
else if(WrittenMessages[pID] == 4) { strmid(VMessages[pID][3], msg, 0, strlen(msg), 255); VCaller[pID][3] = playerid; }
else if(WrittenMessages[pID] == 5) { strmid(VMessages[pID][4], msg, 0, strlen(msg), 255); VCaller[pID][4] = playerid; }
EDIT: ohye, it compiles with no errors.


.