28.11.2011, 22:05
Galera tava fazendo esse gm, e comзei a pegar parte de um outro e me enrrolei um pouco e ficou com esses erros e warning
erros e war:
Linhas:
erros e war:
PHP код:
C:\Users\Antonio\samp host\filterscripts\Mala.pwn(35) : warning 217: loose indentation
C:\Users\Antonio\samp host\filterscripts\Mala.pwn(21) : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\Antonio\samp host\filterscripts\Mala.pwn(21 -- 38) : error 010: invalid function or declaration
C:\Users\Antonio\samp host\filterscripts\Mala.pwn(21 -- 40) : error 010: invalid function or declaration
C:\Users\Antonio\samp host\filterscripts\Mala.pwn(21 -- 43) : error 010: invalid function or declaration
C:\Users\Antonio\samp host\filterscripts\Mala.pwn(21 -- 43) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
PHP код:
#include <a_samp>
main()
{
print("\n----------------------------------");
print(" Teste Mala");
print("----------------------------------\n");
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
//==================================[mala]=====================================
if(strcmp(cmdtext, "/comprarmala", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerMoney(playerid)<2000)return SendClientMessage(playerid, 0xFFFFFFFF,"Vocк nгo tem R$1000!");
SetPlayerAttachedObject( playerid, 0, 1212, 6, 0.118311, 0.029233, 0.029525, 0.000000, 260.214324, 0.000000, 1.000000, 1.000000, 1.000000 );
GivePlayerMoney(playerid, -2000);
}
}
return 1;
}
if(strcmp(cmd, "/darmala", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USO: /darmala [playerid/Parte-do-Nick] [quantia]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USO: /darmala [playerid/Parte-do-Nick] [quantia]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999)
{
SendClientMessage(playerid, COLOR_GRAD1, "Escolha entre 1 e R$: 50000");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Este comando nгo й habilitado para se usar nesse lugar.");
return 1;
}
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoneyEx(playerid);
if (moneys > 0 && playermoney >= moneys)
{
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoneyEx(playerid, (0 - moneys));
GivePlayerMoneyEx(giveplayerid, moneys);
format(string, sizeof(string), " Vocк enviou R$: %d para %s(Jogador: %d)", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " Vocк recebeu R$: %d de %s(Jogador: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s pagou R$: %d para %s", sendername, moneys, giveplayer);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "%s deu algum dinheiro para %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Quantia invбlida");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк estб longe do persongem");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d nгo й um jogador Ativo.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 0;
}
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}