27.08.2011, 11:24
Hi! I have an problem. If I compile my GM, the compiler crashes and when i start my server, it says invalid/unsupported p-code file format.
This is the script what i added:
The enums are working and if i edit the Warnings= from ini file, it works too but it doesnt ban, tho.
This is the script what i added:
pawn Код:
if(strcmp(cmd, "/warn", true )== 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
return SendClientMessage(playerid, COLOR_GREY, " VIGA: Sa ei ole sisse logitud. ");
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GREY, " VIGA: Ainult adminid vхivad seda kдsklust kasutada. ");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage( playerid, COLOR_GRAD2, " DEBUG: /hoiata <ID/NIMI> <Pхhjus> ");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if( giveplayerid != INVALID_PLAYER_ID )
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ''))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage( playerid, COLOR_GRAD2, " DEBUG: /hoiata <ID/NIMI> <Pхhjus>");
return 1;
}
PlayerInfo[giveplayerid][pWarns] ++;
if(PlayerInfo[giveplayerid][pWarns] >= 5)
{
PlayerInfo[playerid][pLocked] = 2;
SendClientMessage(playerid, COLOR_LIGHTRED, "Sa said banni, sest sul tдitusid 5 hoiatust.");
Ban(giveplayerid);
return 1;
}
format(string, sizeof(string), "Admin %s hoiatas sind. Pхhjus: %s. ", sendername, result);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Sa hoiatasid %s'i. Pхhjus: %s.", giveplayer, result);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
return 1;
}
}
}
return 1;
}
}