[Ayuda] Bank + Gangs + Properties + Bounty
#1

Hola gente!
Bueno, descarguй un FS que venia buscando hace tiempo, le hice algunas modificaciones a mi necesidad, pero tengo un problema que no puedo solucionar.
Cuando yo compro el Caligulas, y me voy del juego, cualquier jugador que entre serб el propietario del Caligulas :/.

Lo mismo pasaba con el banco, pero ya lo solucione. ("heredaba" la plata de otro jugador)
Pero con lo de las propiedades no puedo :/.

Les dejo todo el comando /comprar asi lo ven ustedes mismos...
pawn Код:
if(strcmp(cmd, "/comprar", true) == 0) {
        new property=999;

        if(IsPlayerInCheckpoint(playerid)) {
            switch (playerCheckpoint[playerid]) {
                case CP_ALAHAM:{
                    property = P_ALAHAM;
                }
                case CP_DIDERSACHS:{
                    property = P_DIDERSACHS;
                }
                case CP_BAR:{
                    property = P_BAR;
                }
                case CP_HAIRSTUD:{
                    property = P_HAIRSTUD;
                }
                case CP_ZIP:{
                    property = P_ZIP;
                }
                case CP_BINCO:{
                    property = P_BINCO;
                }
                case CP_TATOO:{
                    property = P_TATOO;
                }
                case CP_GOLF:{
                    property = P_GOLF;
                }
                case CP_WANG:{
                    property = P_WANG;
                }
                case CP_HOTEL:{
                    property = P_HOTEL;
                }
                case CP_OTTOS:{
                    property = P_OTTOS;
                }
                case CP_DRAGON:{
                    property = P_DRAGON;
                }
                case CP_CALIGULA:{
                    property = P_CALIGULA;
                }
                case CP_SEXSHOP:{
                    property = P_SEXSHOP;
                }
                case CP_CATHAY:{
                    property = P_CATHAY;
                }
                case CP_VERONA:{
                    property = P_VERONA;
                }
                case CP_ZERORC:{
                    property = P_ZERORC;
                }
                case CP_JIZZYS:{
                    property = P_JIZZYS;
                }
                case CP_PIRAMID:{
                    property = P_PIRAMID;
                }
            }

            if(property==999) {
                SendClientMessage(playerid, COLOR_YELLOW, "Necesitas estar en el checkpoint de la propiedad para comprarla!");
                return 1;
            }

//          property--;

            if(GetPlayerMoney(playerid) < propertyValues[property]) {
                SendClientMessage(playerid, COLOR_RED, "No tienes dinero suficiente para comprar esta propiedad.");
                return 1;
            }
            if(propertyOwner[property]==playerid) {
                SendClientMessage(playerid, COLOR_RED, "Eres dueсo de esta propiedad.");
                return 1;
            }

            if(propertyOwner[property] < 999) {
                GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
                GivePlayerMoney(propertyOwner[property], propertyValues[property]);
                format (string, sizeof(string), "Tu propiedad, %s, fue comprada por %s (id: %d).",propertyNames[property],giveplayer,playerid);
                SendClientMessage(propertyOwner[property], COLOR_RED, string);
            }

            GivePlayerMoney(playerid, 0-propertyValues[property]);

            propertyOwner[property]=playerid;

            format(string, sizeof(string), "Compraste la propiedad %s!", propertyNames[property]);
            SendClientMessage(playerid, COLOR_GREEN, string);

        } else {
            SendClientMessage(playerid, COLOR_YELLOW, "Necesitas estar en el checkpoint de la propiedad para comprarla!");
            return 1;
        }


        return 1;
    }
Si necesitan algo mas, avisenme!
Reply
#2

Quote:

Si necesitan algo mбs avisenme!

Dudo que sea el comando, da algo mбs de codigo xD

Quote:

Pasame el fs XD Jaja

EDIT: Checa en

pawn Код:
public OnPlayerDisconnect..
Que la variable este a 0, oh si no seteala a -1, quedandote asн.

pawn Код:
public OnPlayerDisconnect(playerid..no recuerdo qe mas xD)
{
variable = -1;
}
Reply
#3

Esta todo en ese comando, ahi es cuando setea que el jugador es dueсo de una propiedad.

El FS esta en la seccion inglйs, usa el buscador y busca "Gangs Bank Bounty" y te saldrб.
Deberбs traducirlo.
Reply
#4

pawn Код:
propertyOwner[property]=playerid;
envez de usar eso, pon el nombre del jugador...
Reply
#5

Y como se haria?
pawn Код:
propertyOwner[property]=GetPlayerName(playerid);
No, no? xD
Reply
#6

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
strmid(ownername, name, 0, sizeof(ownername));
Reply
#7

Y quedarнa propertyOwner[property] = ownername ?

Gracias seсor Fuego :B
Reply
#8

XFuego
Reply
#9

"E:\Fuck\samp03csvr_win32\filterscripts\banks.pwn( 854) : error 033: array must be indexed (variable "ownername")
E:\Fuck\samp03csvr_win32\filterscripts\banks.pwn(8 6 : error 006: must be assigned to an array"

pawn Код:
new name[MAX_PLAYER_NAME], ownername[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        strmid(ownername, name, 0, sizeof(ownername));

            if(propertyOwner[property]==ownername)
            {
/*854*/         SendClientMessage(playerid, COLOR_RED, "Eres dueсo de esta propiedad.");
                return 1;
            }

/*868*/     propertyOwner[property]=ownername;

Nunca use strmid, sino hubiera intentado solucionrlo :/
Reply
#10

usa Strcmp para eso
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)