29.05.2013, 20:34
Eae galera meu comando de /bantempo ta dando erros
alguem me ajuda a arrumar esses erros rep pra qm ajudar
pawn Код:
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(11647) : error 047: array sizes do not match, or destination array is too small
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(11653) : error 012: invalid function call, not a valid address
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(11653) : warning 215: expression has no effect
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(11653) : error 001: expected token: ";", but found ")"
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(11653) : error 029: invalid expression, assumed zero
C:\Users\pppp\Desktop\MeuRPG\gamemodes\RPG.pwn(11653) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
pawn Код:
new giveplayerid[90];
new tmp[90];
new Returnn;
if(strcmp(cmd, "/banirtempo", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "USE: /bantemp [id] [dias] [motivo]");
return true;
}
giveplayerid = Returnn(tmp);
if(pAdmin[playerid] == 5)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(pAdmin[playerid] == 5)
{
SendClientMessage(playerid, Vermelho, "Vocк nгo pode banir este admin!");
return true;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "USE: /bantemp [id] [dias] [motivo]");
return true;
}
new diasban = strval(tmp);
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, Vermelho, "USE: /banirtempo [id] [dias] [motivo]");
return true;
}
getdate(year, month, day);
if(diasban > 9999)
{
SendClientMessage(playerid, Vermelho, "[ERRO] Vocк definiu muitos dias!");
return 1;
}
format(string, sizeof(string), "AdmCmd: %s foi banido temporariamente (%d dias) por %s, Motivo: %s (%d-%d-%d)", giveplayer, diasban, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "AdmCmd: %s foi banido temporariamente (%d dias) por %s, Motivo: %s", giveplayer, diasban, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pDiaBanTemp] = day+diasban;
PlayerInfo[giveplayerid][pMesBanTemp] = month;
PlayerInfo[giveplayerid][pAnoBanTemp] = year;
for(new dias = 1; dias < diasban; dias++)
{
if(PlayerInfo[giveplayerid][pMesBanTemp] == 1 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 2 && PlayerInfo[giveplayerid][pDiaBanTemp] > 28)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 28;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 3 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 4 && PlayerInfo[giveplayerid][pDiaBanTemp] > 30)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 30;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 5 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 6 && PlayerInfo[giveplayerid][pDiaBanTemp] > 30)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 30;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 7 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 8 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 9 && PlayerInfo[giveplayerid][pDiaBanTemp] > 30)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 30;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 10 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 11 && PlayerInfo[giveplayerid][pDiaBanTemp] > 30)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 30;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] == 12 && PlayerInfo[giveplayerid][pDiaBanTemp] > 31)
{
PlayerInfo[giveplayerid][pDiaBanTemp] -= 31;
PlayerInfo[giveplayerid][pMesBanTemp]++;
}
if(PlayerInfo[giveplayerid][pMesBanTemp] > 12)
{
PlayerInfo[giveplayerid][pMesBanTemp] -= 12;
PlayerInfo[giveplayerid][pAnoBanTemp]++;
}
}
OnPlayerSave(giveplayerid);
TextDrawShowForPlayer(giveplayerid, TextBan[giveplayerid]);
BanTemp(giveplayerid, result, PlayerName(playerid));
return true;
}
}//not connected
}
else
{
QQIssoNovinha;
}
}
return true;
}