[PAWNO][PREGUNTAS]Poned aqui los defines, forward y demas que no sepais que son.
#1

Hola, os pondre unos cuantos defines, forwards y cosas asi aver si me pueden decir para que sirven, porfa. Si los solucionaron los pongo con //Solucionado y si son nuevos los pondre como "NUEVO y la fecha", si otros quereis saber para que sirve algo ponedlo aqui
08-01-2010
pawn Код:
#define MAX_STRING 255
#define CHECKPOINT_NONE 0
#define CHECKPOINT_HOME 12
#define RunOutTime 15000
#define RefuelWait 5000
#define CAR_AMOUNT 700
pawn Код:
new Security = 0;
new CreatedCars[100];
new CreatedCar = 0;
new Tax = 0;
new TaxValue = 0;
new Jackpot = 0;
new StartingPaintballRound = 0;
new AnnouncedPaintballRound = 0;
new PaintballPlayers = 0;
new PaintballRound = 0;
new PaintballWinner = 999;
new PaintballWinnerKills = 0;
new StartingKartRound = 0;
new EndingKartRound = 0;
new AnnouncedKartRound = 0;
new KartingPlayers = 0;
new KartingRound = 0;
new FirstKartWinner = 999;
new SecondKartWinner = 999;
new ThirdKartWinner = 999;
new InRing = 0;
new RoundStarted = 0;
new BoxDelay = 0;
new Boxer1 = 255;
new Boxer2 = 255;
new TBoxer = 255;
new PlayerBoxing[MAX_PLAYERS];
new hitfound = 0;
new hitid = 999;
new Medics = 0;
new MedicCall = 999;
new MedicCallTime[MAX_PLAYERS];
new Mechanics = 0;
new MechanicCall = 999;
new MechanicCallTime[MAX_PLAYERS];
new TaxiDrivers = 0;
new TaxiCall = 999;
new TaxiCallTime[MAX_PLAYERS];
new TaxiAccepted[MAX_PLAYERS];
new BusDrivers = 0;
new BusCall = 999;
new BusCallTime[MAX_PLAYERS];
new BusAccepted[MAX_PLAYERS];
new TransportDuty[MAX_PLAYERS];
new TransportValue[MAX_PLAYERS];
new TransportMoney[MAX_PLAYERS];
new TransportTime[MAX_PLAYERS];
new TransportCost[MAX_PLAYERS];
new TransportDriver[MAX_PLAYERS];
new JobDuty[MAX_PLAYERS];
new RegistrationStep[MAX_PLAYERS];
new MapIconsShown[MAX_PLAYERS];
new OnCK[MAX_PLAYERS];
new GettingCK[MAX_PLAYERS];
new PlayerPaintballing[MAX_PLAYERS];
new PlayerPaintballKills[MAX_PLAYERS];
new PlayerKarting[MAX_PLAYERS];
new PlayerInKart[MAX_PLAYERS];
new SchoolSpawn[MAX_PLAYERS];
new TakingLesson[MAX_PLAYERS];
new UsedFind[MAX_PLAYERS];
new PlayersChannel[MAX_PLAYERS];
new PlayerOnMission[MAX_PLAYERS];
new MissionCheckpoint[MAX_PLAYERS];
new WatchingTV[MAX_PLAYERS];
new NoFuel[MAX_PLAYERS];
new MatsHolding[MAX_PLAYERS];
new DivorceOffer[MAX_PLAYERS];
new MarriageCeremoney[MAX_PLAYERS];
new ProposeOffer[MAX_PLAYERS];
new ProposedTo[MAX_PLAYERS];
new GotProposedBy[MAX_PLAYERS];
new MarryWitness[MAX_PLAYERS];
new MarryWitnessOffer[MAX_PLAYERS];
new TicketOffer[MAX_PLAYERS];
new TicketMoney[MAX_PLAYERS];
new PlayerStoned[MAX_PLAYERS];
new ConsumingMoney[MAX_PLAYERS];
new BringingPaper[MAX_PLAYERS];
new GotPaper[MAX_PLAYERS];
new WritingPaper[MAX_PLAYERS];
new WritingPaperNumber[MAX_PLAYERS];
new WritingLine[MAX_PLAYERS];
new FishCount[MAX_PLAYERS];
new SpawnChange[MAX_PLAYERS];
new TutTime[MAX_PLAYERS];
new PlayerDrunk[MAX_PLAYERS];
new PlayerDrunkTime[MAX_PLAYERS];
new PlayerTazeTime[MAX_PLAYERS];
new FindTimePoints[MAX_PLAYERS];
new FindTime[MAX_PLAYERS];
new BoxWaitTime[MAX_PLAYERS];
new TestFishes[MAX_PLAYERS];
new PaperOffer[MAX_PLAYERS];
new BoxOffer[MAX_PLAYERS];
new CarOffer[MAX_PLAYERS];
new CarPrice[MAX_PLAYERS];
new CarID[MAX_PLAYERS];
new CarCalls[MAX_PLAYERS];
new GotHit[MAX_PLAYERS];
new GoChase[MAX_PLAYERS];
new GetChased[MAX_PLAYERS];
new OrderReady[MAX_PLAYERS];
new ConnectedToPC[MAX_PLAYERS];
new MedicTime[MAX_PLAYERS];
new NeedMedicTime[MAX_PLAYERS];
new MedicBill[MAX_PLAYERS];
new PlayerTied[MAX_PLAYERS];
new PlayerCuffed[MAX_PLAYERS];
new PlayerCuffedTime[MAX_PLAYERS];
new LiveOffer[MAX_PLAYERS];
new TalkingLive[MAX_PLAYERS];
new PlacedNews[MAX_PLAYERS];
new SelectChar[MAX_PLAYERS];
new SelectCharID[MAX_PLAYERS];
new SelectCharPlace[MAX_PLAYERS];
new ChosenSkin[MAX_PLAYERS];
new GettingJob[MAX_PLAYERS];
new GuardOffer[MAX_PLAYERS];
new GuardPrice[MAX_PLAYERS];
new ApprovedLawyer[MAX_PLAYERS];
new CallLawyer[MAX_PLAYERS];
new WantLawyer[MAX_PLAYERS];
new CurrentMoney[MAX_PLAYERS];
new KickPlayer[MAX_PLAYERS];
new Robbed[MAX_PLAYERS];
new RobbedTime[MAX_PLAYERS];
new CP[MAX_PLAYERS];
new MoneyMessage[MAX_PLAYERS];
new Condom[MAX_PLAYERS];
new STDPlayer[MAX_PLAYERS];
new SexOffer[MAX_PLAYERS];
new SexPrice[MAX_PLAYERS];
new RepairOffer[MAX_PLAYERS];
new RepairPrice[MAX_PLAYERS];
new RefillOffer[MAX_PLAYERS];
new RefillPrice[MAX_PLAYERS];
new RepairCar[MAX_PLAYERS];
new DrugOffer[MAX_PLAYERS];
new DrugPrice[MAX_PLAYERS];
new DrugGram[MAX_PLAYERS];
new JailPrice[MAX_PLAYERS];
new WantedPoints[MAX_PLAYERS];
new WantedLevel[MAX_PLAYERS];
new OnDuty[MAX_PLAYERS];
new gPlayerCheckpointStatus[MAX_PLAYERS];
new gPlayerLogged[MAX_PLAYERS];
new gPlayerLogTries[MAX_PLAYERS];
new gPlayerSpawned[MAX_PLAYERS];
new gActivePlayers[MAX_PLAYERS];
new gLastCar[301];
new gOoc[MAX_PLAYERS];
new gNews[MAX_PLAYERS];
new gFam[MAX_PLAYERS];
new BigEar[MAX_PLAYERS];
new Spectate[MAX_PLAYERS];
new CellTime[MAX_PLAYERS];
new StartTime[MAX_PLAYERS];
new HireCar[MAX_PLAYERS];
new SafeTime[MAX_PLAYERS];
new HidePM[MAX_PLAYERS];
new PhoneOnline[MAX_PLAYERS];
new gDice[MAX_PLAYERS];
new gGas[MAX_PLAYERS];
new gSpeedo[MAX_PLAYERS];
new gSpentCash[MAX_PLAYERS];
new FirstSpawn[MAX_PLAYERS];
new SwitchKey[MAX_PLAYERS];
new Fixr[MAX_PLAYERS];
new Locator[MAX_PLAYERS];
new Mobile[MAX_PLAYERS];
new RingTone[MAX_PLAYERS];
new CallCost[MAX_PLAYERS];
new gPlayerAccount[MAX_PLAYERS];
new gPlayerMission[MAX_PLAYERS];
new gLastDriver[302];
new gCarLock[265];
new MissionPlayable = 0;
new noooc = 0;
new adds = 1;
new addtimer = 60000;
new Float:rx, Float:ry, Float:rz;
new carselect[15];
new objstore[128];
new cbjstore[128];
new motd[256];
new rccounter = 0;
new ghour = 0;
new gminute = 0;
new gsecond = 0;
new numplayers = 0;
new dollah = 1000;
new realtime = 1;
new wtime = 15;
new levelcost = 25000;
new deathcost = 500;
new callcost = 10;
new realchat = 1;
new timeshift = -1;
new shifthour;
new othtimer;
new synctimer;
new newmistimer;
new unjailtimer;
new turftimer;
new pickuptimer;
new spectatetimer;
new idletimer;
new productiontimer;
new accountstimer;
new checkgastimer;
new stoppedvehtimer;
new cartimer;
new intrate = 1;
new levelexp = 4;
new idletime = 600000;
new civnokill = 0;
new suecost = 2000;
new cchargetime = 60;
new txtcost = 25;
Ahh y para no hacer nuevo post y ya que va sobre algo parecido al tema os digo:
їComo se cambia eso de poner
pawn Код:
#define
#include
forward
new
public
y esas cosas para poner algo diferente? їO o se puede?
Reply
#2

Todo depende del script lo que sea cada cosa.

Si yo en un script pongo:
pawn Код:
SetPlayerHealth(playerid, 100.0);
O si pongo:
pawn Код:
#define GUADSHudabfh39gh29h82h 100.0
SetPlayerHealth(playerid, GUADSHudabfh39gh29h82h);
es exactamente lo mismo.
Asн que depende totalmente del script lo que sea cada variable, cada define, y cada cosa. Deberнas preguntбrselo al autor del script, dudo que te podamos dar alguna ayuda con respecto a cada cosa en especнfico.
Reply
#3

Quote:
Originally Posted by Haydoon
[/pawn]
Ahh y para no hacer nuevo post y ya que va sobre algo parecido al tema os digo:
їComo se cambia eso de poner
pawn Код:
#define
#include
forward
new
public
y esas cosas para poner algo diferente? їO o se puede?
Primero tienes que entender que son antes de modificarlos:

define:
pawn Код:
#define ALGO 15
#define OTRO "hola"
Los defines sirven para darle valor o asignarle algo a una serie de letras, como dice la misma, define alguna palabra. #define ALGO 15 significa que le estamos dando valor a "ALGO" y este valor es "15". #define OTRO "hola"
significa que a "OTRO" otro le asignamos el string (porque esta entre comillas) "hola".

їPara que hacerlo?
Para que cuando necesitemos uno de esos valores pero no lo tengamos o no lo queremos copiar simplemente utilizamos la palabra que definimos. Por ejemplo:

Una cifra muy grande:

pawn Код:
#define CIFRA 24531784
#define MENSAJE "Hola, te gusta mi mensaje"
Supongamos que le queremos dar dinero a alguien y que la cantidad sea 24531784, entonces en si ya definimos algo que tenga ese valor, lo colocamos en vez de estar copiando toda la cantidad.
pawn Код:
GivePlayerMoney(playerid, CIFRA);
// en vez de:
GivePlayerMoney(playerid, 24531784);
Tambiйn en el caso de los mensajes:
pawn Код:
// ya definimos MENSAJE, que es "Hola, te gusta mi mensaje", ya poodemos usarlo:
SendClientMessage(playerid, COLOR, MENSAJE);
// en vez de:
SendClientMessage(playerid, COLOR, "Hola, te gusta mi mensaje");
Un ejemplo muy comъn es el caso de los colores, los cuales los definimos antes de ponernos a recordarlos como locos.

include:
Sirve para agregar algo que este fuera del script al script, como los archivos que estan en la carpeta "includes".

forward:
Sirve para anticipar que vamos a hacer una funciуn o public, se debe colocar el formato de la funcion y un punto y coma al final.
pawn Код:
forward Funcion(formato, parametros, etc);
new:
Sirve para crear variables, creo que esto ya debe ser mas que obvio:
pawn Код:
new Variable;
public:
Se pone antes de una funcion, la cual ya hemos anunciado anteriormente.
pawn Код:
forward MandarMensajeDeJuego();
public MandarMensajeDeJuego()
{
  SendClientMessageToAll(COLOR, MENSAJE);
  return 1;
}
Reply
#4

Jaja muchas gracias por el tutorial xD, pero yo digo que embede poner #define y lo que se tenga que definir que se cambie a #definir
Si hay algun archivo donde se modifica eso Zamaroth vale pero esq no se ingles xD, el Gamemode base es el GodFather. Yo queria estas cosas para traducirlo todo todito al espaсol. y luego si me sale traducir el pawno al espaсol jeje. aunque me tire 3 aсos
Reply
#5

No, no vas a poder cambiar los #defines ni los new ni nada de eso. Es un lenguaje de programaciуn y estб en inglйs, no queda otra mбs que conocer inglйs algo bбsico para poder programar, ya que todos los lenguajes que conozco estбn en inglйs.
Reply
#6

Bueno Tampoco es para morirse jeje
Reply
#7

Usa eso, tampoco es difнcil de entender que significa new y #define y para que se usan. Yo uso #define para colores.

pawn Код:
#define Color_Rojo 0xFF0000FF
Y ya asн no tengo que buscar el color cada vez que quiera poner un comando ni que sea muy parecido.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)