strmid don't work
#1

pawn Код:
// enum pInfo
pWarnName1[24],
pWarnReason1[64],

// OnPlayerConnect
strmid(PlayerInfo[playerid][pWarnName1], "Nobody", 0, strlen("Nobody"), 255);
strmid(PlayerInfo[playerid][pWarnReason1], "Empty", 0, strlen("Empty"), 255);

// OnPlayerRegister & OnPlayerDataSave
format(var, 64, "WarnName1=%s\n",PlayerInfo[playerid][pWarnName1]);fwrite(hFile, var);
format(var, 64, "WarnReason1=%s\n",PlayerInfo[playerid][pWarnReason1]);fwrite(hFile, var);

// OnPlayerLogin
if(strcmp(key , "WarnName1" , true) == 0) { val = ini_GetValue(Data); strmid(PlayerInfo[playerid][pWarnName1], val, 0, strlen(val)-1, 255); }
if(strcmp(key , "WarnReason1" , true) == 0) { val = ini_GetValue(Data); strmid(PlayerInfo[playerid][pWarnReason1], val, 0, strlen(val)-1, 255); }
Here is the command: http://pastie.org/748515

Here is the bugged part from command:

pawn Код:
SendFormattedMessage(playerid,COLOR_LIGHTGREEN,"[DEBUG]: Sendername: %s | Reason: %s",sendername,result);
strmid(PlayerInfo[giveplayerid][pWarnName1],sendername,0,strlen(sendername));
strmid(PlayerInfo[giveplayerid][pWarnReason1],result,0,strlen(result));
SendFormattedMessage(playerid,COLOR_LIGHTGREEN,"[DEBUG]: WarnName1: %s | WarnReason1: %s",PlayerInfo[giveplayerid][pWarnName1],PlayerInfo[giveplayerid][pWarnReason1]);
And here is the bug: http://files.uploadffs.com/a/b/c1e8bfe0/untitled.PNG
Reply


Messages In This Thread
strmid don't work - by UsaBoy91 - 18.12.2009, 10:18
Re: strmid don't work - by UsaBoy91 - 18.12.2009, 13:54
Re: strmid don't work - by dice7 - 18.12.2009, 15:50
Re: strmid don't work - by UsaBoy91 - 18.12.2009, 17:52
Re: strmid don't work - by Joe Staff - 18.12.2009, 17:55
Re: strmid don't work - by UsaBoy91 - 18.12.2009, 18:01
Re: strmid don't work - by Jefff - 18.12.2009, 18:30
Re: strmid don't work - by MJ! - 18.12.2009, 18:52

Forum Jump:


Users browsing this thread: 1 Guest(s)