18.12.2009, 10:18
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 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]);