[Ajuda] Como arrumo esse bug
#1

Galera tem um bug quando compra casa o servidor cai alguem mi ajuda a resolver.

/criarcasa

Quote:

if(strcmp(cmd, "/criarcasa", true) == 0)
{
if(IsPlayerAdmin(playerid)) {
for(new c = 0; c < MAX_CASAS; c++) {
new preco, int;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/criarcasa [preзo] [interiorID]");
return 1;
}
preco = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/criarcasa [preзo] [interiorID]");
return 1;
}
int = strval(tmp);
format(string, sizeof(string), "/Casas/casa%d.ini", proximacasa);
if(!dini_Exists(string)) {
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
dini_Create(string);
dini_FloatSet(string, "PosX", X);
dini_FloatSet(string, "PosY", Y);
dini_FloatSet(string, "PosZ", Z);
dini_IntSet(string, "Int", int);
dini_IntSet(string, "Mundo", proximacasa);
dini_IntSet(string, "TDono", 0);
dini_Set(string, "Dono", "Ninguem");
dini_Set(string,"Mensagemc","Nenhuma");
dini_IntSet(string, "Preco", preco);
dini_IntSet(string, "Trancada", 0);
new pickupid;
pickupid = CreatePickup(1273, 1, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"), -1);
dini_IntSet(string, "Id", pickupid);
new Casa2[128];
format(Casa2, sizeof(Casa2),"Casa ID %d", proximacasa);
CasaTxT[c] = Create3DTextLabel(Casa2,-1,dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ")+0.75,20.0,0,1);
new string2[256];
format(string2, sizeof(string2),"| INFO | Vocк criou uma casa! ID da casa: %d / Preзo: %d / Interior: %d.",proximacasa, preco, int);
SendClientMessage(playerid,0xFFFFFFAA,string2);
}
proximacasa++;
}
}
return 1;
}

/comprarcasa

Quote:

if(strcmp(cmdtext, "/comprarcasa", true) == 0)
{
for(new c = 0; c < MAX_CASAS; c++) {
format(string, sizeof(string), "/Casas/casa%d.ini", c);
if(dini_Exists(string)) {
if(IsPlayerInRangeOfPoint(playerid, 2.0, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"))) {
if(dini_Int(string, "TDono") == 0) {
if(GetPlayerGrana(playerid) >= dini_Int(string, "Preco")) {
if(GetCasas(playerid) < 1) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
dini_IntSet(string, "TDono", 1);
dini_Set(string, "Dono", pname);
GivePlayerGrana(playerid, -dini_Int(string, "Preco"));
new pickupid;
DestroyPickup(dini_Int(string, "Id"));
pickupid = CreatePickup(1272, 1, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"), -1);
dini_IntSet(string, "Id", pickupid);
new str[128];
format(str, sizeof(str), "| CASAS | O jogador %s comprou a casa ID %d.", pname, c);
SendClientMessageToAll(0xC0C0C0AA, str);
GameTextForPlayer(playerid,"~w~Casa comprada!", 2000, 1);
new Casa2[128];
format(Casa2, sizeof(Casa2), "Casa ID %d",c);
Update3DTextLabelText(CasaTxT[c],-1, Casa2);
OnPlayerCommandText(playerid, "/nascercasa");
}
else {
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк sу pode ter uma casa!");
}
}
else {
SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem dinheiro!");
}
}
else {
SendClientMessage(playerid, Vermelho, "| ERRO | Esta casa nгo estб a venda!");
}
}
else {
}
}
}
return 1;
}

Bom pessoal me ajudem pf
Reply
#2

Hб os arquivos que salvam as casas criadas na pasta scriptfiles?
Reply
#3

a pasta Casas sim
Reply
#4

Tente desta forma.

Quote:

Criar pasta "Casas" dentro de scriptfiles.

pawn Код:
if(strcmp(cmd, "/criarcasa", true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        for(new c = 0; c < MAX_CASAS; c++)
        {
            new preco, int;
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, Vermelho, "/criarcasa [preзo] [interiorID]");
                return 1;
            }
            preco = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, Vermelho, "/criarcasa [preзo] [interiorID]");
                return 1;
            }
            int = strval(tmp);
            format(string, sizeof(string), "Casas/casa%d.ini", proximacasa);
            if(!dini_Exists(string))
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(playerid, X, Y, Z);
                dini_Create(string);
                dini_FloatSet(string, "PosX", X);
                dini_FloatSet(string, "PosY", Y);
                dini_FloatSet(string, "PosZ", Z);
                dini_IntSet(string, "Int", int);
                dini_IntSet(string, "Mundo", proximacasa);
                dini_IntSet(string, "TDono", 0);
                dini_Set(string, "Dono", "Ninguem");
                dini_Set(string,"Mensagemc","Nenhuma");
                dini_IntSet(string, "Preco", preco);
                dini_IntSet(string, "Trancada", 0);
                new pickupid;
                pickupid = CreatePickup(1273, 1, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"), -1);
                dini_IntSet(string, "Id", pickupid);
                new Casa2[128];
                format(Casa2, sizeof(Casa2),"Casa ID %d", proximacasa);
                CasaTxT[c] = Create3DTextLabel(Casa2,-1,dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ")+0.75,20.0,0,1);
                new string2[256];
                format(string2, sizeof(string2),"| INFO | Vocк criou uma casa! ID da casa: %d / Preзo: %d / Interior: %d.",proximacasa, preco, int);
                SendClientMessage(playerid,0xFFFFFFAA,string2);
            }
            proximacasa++;
        }
    }
    return 1;
}
pawn Код:
if(strcmp(cmdtext, "/comprarcasa", true) == 0)
{
    for(new c = 0; c < MAX_CASAS; c++) {
    format(string, sizeof(string), "Casas/casa%d.ini", c);
    if(dini_Exists(string))
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ")))
        {
            if(dini_Int(string, "TDono") == 0)
            {
                if(GetPlayerGrana(playerid) >= dini_Int(string, "Preco"))
                {
                    if(GetCasas(playerid) < 1)
                    {
                        new pname[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, pname, sizeof(pname));
                        dini_IntSet(string, "TDono", 1);
                        dini_Set(string, "Dono", pname);
                        GivePlayerGrana(playerid, -dini_Int(string, "Preco"));
                        new pickupid;
                        DestroyPickup(dini_Int(string, "Id"));
                        pickupid = CreatePickup(1272, 1, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"), -1);
                        dini_IntSet(string, "Id", pickupid);
                        new str[128];
                        format(str, sizeof(str), "| CASAS | O jogador %s comprou a casa ID %d.", pname, c);
                        SendClientMessageToAll(0xC0C0C0AA, str);
                        GameTextForPlayer(playerid,"~w~Casa comprada!", 2000, 1);
                        new Casa2[128];
                        format(Casa2, sizeof(Casa2), "Casa ID %d",c);
                        Update3DTextLabelText(CasaTxT[c],-1, Casa2);
                        OnPlayerCommandText(playerid, "/nascercasa");
                    }
                    else
                    {
                        SendClientMessage(playerid, Vermelho, "| ERRO | Vocк sу pode ter uma casa!");
                    }
                }
                else
                {
                    SendClientMessage(playerid, Vermelho, "| ERRO | Vocк nгo tem dinheiro!");
                }
            }
            else
            {
                SendClientMessage(playerid, Vermelho, "| ERRO | Esta casa nгo estб a venda!");
            }
        }
    }
    return 1;
}
Reply
#5

bom deu isso aqui.

Quote:

C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1163) : error 004: function "UpdateTime" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1794) : error 017: undefined symbol "ResetPlayerGrana"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1812) : error 017: undefined symbol "PlayerName"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1820) : error 017: undefined symbol "PlayerName"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1905) : error 017: undefined symbol "PlayerName"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1905) : error 017: undefined symbol "PlayerName"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1951) : error 017: undefined symbol "GetPlayerGrana"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1962) : error 017: undefined symbol "PlayerName"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(1996) : error 004: function "Logarprof" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2181) : error 017: undefined symbol "pinto"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2182) : error 004: function "ABroadCast" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2201) : error 017: undefined symbol "pinto"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2202) : error 004: function "ChatMods" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2203) : error 004: function "ABroadCast" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2222) : error 017: undefined symbol "pinto"
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2223) : error 004: function "MensagemC" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2224) : error 004: function "ABroadCast" is not implemented
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2266) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2267) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(226 : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2269) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2276) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2283) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2315) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2337) : error 079: inconsistent return types (array & non-array)
C:\Users\Megaware\Desktop\New City Virtual\gamemodes\NVC.pwn(2339) : error 079: inconsistent return types (array & non-array)

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)