[Ajuda] ConflitoІ
#1

Resolvido
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerVirtualWorld

Se o problema nгo for com entrada e saнda, aconselho a vocк a pegar as posiзхes novamente.
Reply
#3

A bola de cristal do F.SAMP ta chegando calma.
Reply
#4

os interiores de casa estгo com interior de bar? n entendi

@Agora entendi...veja o /criarcasa p ver o int q esta la ou use /interiorcasa id do interior ..
Reply
#5

@atualizado
Reply
#6

Algem ajuda?
Reply
#7

o problema deve estar na criaзгo do interior da casa, nao aqui
Reply
#8

Quote:
Originally Posted by PT
Посмотреть сообщение
o problema deve estar na criaзгo do interior da casa, nao aqui
/criarcasa

pawn Код:
if(strcmp(cmd, "/criarcasa", true) == 0) {
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    if(pAdmin[playerid] == 5){
    new tmp[256];
    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_IntSet(string, "Preco", preco);
    dini_IntSet(string, "Trancada", 0);
    dini_IntSet(string, "TMorador", 0);
    dini_Set(string, "Morador", "Ninguem");
    new pickupid;
    pickupid = CreatePickup(1273, 1, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ"), -1);
    dini_IntSet(string, "Id", pickupid);
    proximacasa++;
    }
    }
    return 1;
    }

/entrarcasa

pawn Код:
if(strcmp(cmdtext, "/entrarcasa", true) == 0) {
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    for(new c = 0; c < MAX_CASAS; c++)
    {
    format(string, sizeof(string), "/Casas/casa%d.ini", c);
    if (IsPlayerInRangeOfPoint(playerid, 2.0, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ")))
        {
        if(dini_Int(string, "Trancada") == 1){
        if(strcmp(dini_Get(string, "Dono"), pname, true) == 0 || IsPlayerAdmin(playerid)){
        new strx[256];
        format(strx, sizeof(strx), "/Interiores/int%d.ini", dini_Int(string, "Int"));
        if(dini_Exists(strx)){
        emcasa[playerid] = 1;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        CasaX[playerid] = X;
        CasaY[playerid] = Y;
        CasaZ[playerid] = Z;
        SetPlayerVirtualWorld(playerid, c);
        SetPlayerInterior(playerid, dini_Int(strx, "Int"));
        SetPlayerPos(playerid, dini_Float(strx, "EX"), dini_Float(strx, "EY"), dini_Float(strx, "EZ"));
        SendClientMessage(playerid, Vermelho, "(INFO) Vocк entrou na casa, para sair pressione <ENTER>.");
        }
        }
        } else {
        new strx[256];
        format(strx, sizeof(strx), "/Interiores/int%d.ini", dini_Int(string, "Int"));
        if(dini_Exists(strx)){
        emcasa[playerid] = 1;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        CasaX[playerid] = X;
        CasaY[playerid] = Y;
        CasaZ[playerid] = Z;
        SetPlayerVirtualWorld(playerid, c);
        SetPlayerInterior(playerid, dini_Int(strx, "Int"));
        SetPlayerPos(playerid, dini_Float(strx, "EX"), dini_Float(strx, "EY"), dini_Float(strx, "EZ"));
        SendClientMessage(playerid, Vermelho, "(INFO) Vocк entrou na casa, para sair pressione <ENTER>.");
        }
        }
        }
        }
    return 1;
    }
/entrarcasa em key

pawn Код:
if (newkeys==KEY_SECONDARY_ATTACK && emcasa[playerid] == 0)
        {
        OnPlayerCommandText(playerid, "/entrarcasa");
        return 1;
        }
if (newkeys==KEY_SECONDARY_ATTACK && emcasa[playerid] == 1)
        {
        emcasa[playerid] = 0;
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, CasaX[playerid], CasaY[playerid], CasaZ[playerid]);
        SendClientMessage(playerid, Vermelho, "Vocк saiu da casa.");
        return 1;
        }
Reply
#9

Eu falei ele n acreditou.... acha q sу homem q sabe de pawn hahaha

veja se tem td certo a define e os interiores no gm

pawn Код:
#define PASTA_Int           "/Interiores/%s.ini"         //Diretуrio onde as contas sгo salvas
//======================na outra parte=============
if(!dini_Exists("/Interiores/int0.ini")){
        dini_Create("/Interiores/int0.ini");
        dini_IntSet("/Interiores/int0.ini", "Int", 1);
        dini_FloatSet("/Interiores/int0.ini", "EX", 222.9534);
        dini_FloatSet("/Interiores/int0.ini", "EY", 1287.7649);
        dini_FloatSet("/Interiores/int0.ini", "EZ", 1082.1406);
    }
    if(!dini_Exists("/Interiores/int1.ini")){
        dini_Create("/Interiores/int1.ini");
        dini_IntSet("/Interiores/int1.ini", "Int", 4);
        dini_FloatSet("/Interiores/int1.ini", "EX", 261.0827);
        dini_FloatSet("/Interiores/int1.ini", "EY", 1284.6899);
        dini_FloatSet("/Interiores/int1.ini", "EZ", 1080.2578);
    }
//===============e por fim comandtext==============
if(strcmp(cmd, "/criarcasa", true) == 0) {
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    if(pAdmin[playerid] == 5){
    new tmp[256];
    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_IntSet(string, "Preco", preco);
    dini_IntSet(string, "Trancada", 0);
    dini_IntSet(string, "TMorador", 0);
    dini_Set(string, "Morador", "Ninguem");
    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 string2[222];
                format(string2, sizeof(string2), "Casa %d", proximacasa);
                Create3DTextLabel(string2,0xFFFFFFAA, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ")+0.75,20.0,0,1);
                proximacasa++;
            }
        }
        return 1;
    }
Reply
#10

Quote:
Originally Posted by Dana_scully
Посмотреть сообщение
Eu falei ele n acreditou.... acha q sу homem q sabe de pawn hahaha

veja se tem td certo a define e os interiores no gm

pawn Код:
#define PASTA_Int           "/Interiores/%s.ini"         //Diretуrio onde as contas sгo salvas
//======================na outra parte=============
if(!dini_Exists("/Interiores/int0.ini")){
        dini_Create("/Interiores/int0.ini");
        dini_IntSet("/Interiores/int0.ini", "Int", 1);
        dini_FloatSet("/Interiores/int0.ini", "EX", 222.9534);
        dini_FloatSet("/Interiores/int0.ini", "EY", 1287.7649);
        dini_FloatSet("/Interiores/int0.ini", "EZ", 1082.1406);
    }
    if(!dini_Exists("/Interiores/int1.ini")){
        dini_Create("/Interiores/int1.ini");
        dini_IntSet("/Interiores/int1.ini", "Int", 4);
        dini_FloatSet("/Interiores/int1.ini", "EX", 261.0827);
        dini_FloatSet("/Interiores/int1.ini", "EY", 1284.6899);
        dini_FloatSet("/Interiores/int1.ini", "EZ", 1080.2578);
    }
//===============e por fim comandtext==============
if(strcmp(cmd, "/criarcasa", true) == 0) {
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    if(pAdmin[playerid] == 5){
    new tmp[256];
    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_IntSet(string, "Preco", preco);
    dini_IntSet(string, "Trancada", 0);
    dini_IntSet(string, "TMorador", 0);
    dini_Set(string, "Morador", "Ninguem");
    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 string2[222];
                format(string2, sizeof(string2), "Casa %d", proximacasa);
                Create3DTextLabel(string2,0xFFFFFFAA, dini_Float(string, "PosX"), dini_Float(string, "PosY"), dini_Float(string, "PosZ")+0.75,20.0,0,1);
                proximacasa++;
            }
        }
        return 1;
    }
Deu nada... sу teve uma mudanзa de que ao chegar no pickup da casa(nao comprada) vai pras mesmas coordenadas...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)