Convert
#1

HELP Then how to convert commands YSI to strcmp or ZCMD like this CMD


Quote:

YCMD:kreirajkucu(playerid, params[],help)
{
#pragma unused help
if(!IsPlayerAdmin(playerid)) return SCM(playerid,-1,"[HS] "CRVENA"Nemate ovlastenje za koriscenje ove komande!");
new idkuce,vrsta,level,cena,Float:X,Float:Y,Float:Z,fk uce[80],string[400]; GetPlayerPos(playerid,X,Y,Z);
if(sscanf(params, "iiii",idkuce,vrsta,level,cena)) return SCM(playerid,-1,""CRVENA"HS | "SIVA"/kreirajkucu [ID] [Vrsta] [Level] [Cena]");
if(idkuce >= MAX_KUCA) return SCM(playerid,-1, ""CRVENA"HS | "SIVA"Maximum kuca je ogranicen ne mozes koristiti taj ID!");
format(fkuce, sizeof(fkuce), KUCE_FILE, idkuce);
if(fexist(fkuce)) return SCM(playerid,-1, "HS | "SPLAVA"ID te kuce vec postoji!");
if(vrsta == 0) // MALA KUCA
{
KucaInfo[idkuce][kIzlazX] = 223.043991;
KucaInfo[idkuce][kIzlazY] = 1289.259888;
KucaInfo[idkuce][kIzlazZ] = 1082.199951;
KucaInfo[idkuce][kInt] = 1;
strmid(KucaInfo[idkuce][kVrsta],"Mala Kuca",0,strlen("Mala Kuca"),255);
KucaInfo[idkuce][kPromenaIntKuce] = 1;
}
else if(vrsta == 1) // SREDNJA KUCA
{
KucaInfo[idkuce][kIzlazX] = 225.756989;
KucaInfo[idkuce][kIzlazY] = 1240.000000;
KucaInfo[idkuce][kIzlazZ] = 1082.149902;
KucaInfo[idkuce][kInt] = 2;
strmid(KucaInfo[idkuce][kVrsta],"Srednja Kuca",0,strlen("Srednja Kuca"),255);
KucaInfo[idkuce][kPromenaIntKuce] = 2;
}
else if(vrsta == 2) // VELIKA KUCA
{
KucaInfo[idkuce][kIzlazX] = 235.508994;
KucaInfo[idkuce][kIzlazY] = 1189.169897;
KucaInfo[idkuce][kIzlazZ] = 1080.339966;
KucaInfo[idkuce][kInt] = 3;
strmid(KucaInfo[idkuce][kVrsta],"Velika Kuca",0,strlen("Velika Kuca"),255);
KucaInfo[idkuce][kPromenaIntKuce] = 3;
}
KucaInfo[idkuce][kCena] = cena; KucaInfo[idkuce][kLevel] = level; KucaInfo[idkuce][kUlazX] = X; KucaInfo[idkuce][kSkin] = -1;
KucaInfo[idkuce][kUlazY] = Y; KucaInfo[idkuce][kUlazZ] = Z; KucaInfo[idkuce][kProveraVlasnika] = 0; KucaInfo[idkuce][kHeal] = 0;
KucaInfo[idkuce][kNovac] = 0; KucaInfo[idkuce][kZatvoreno] = 1; KucaInfo[idkuce][kVW] = idkuce; KucaInfo[idkuce][kZvono] = 0;
KucaInfo[idkuce][kOruzije] = -1; KucaInfo[idkuce][kMunicija] = 0; KucaInfo[idkuce][kRent] = 0;
strmid(KucaInfo[idkuce][kVlasnik],"Niko",0,strlen("Niko"),255); strmid(KucaInfo[idkuce][kIme],"Default",0,strlen("Default"),255);
format(string,sizeof(string),""ZELENA"Kuca na Prodaju!\nVrsta: "BELA"%s\n"ZELENA"Cena: "BELA"%d\n"ZELENA"Level: "BELA"%d\n"ZELENA"ID Kuce: "BELA"%d\n"ZELENA"Za kupovinu /kupikucu",KucaInfo[idkuce][kVrsta],KucaInfo[idkuce][kCena],KucaInfo[idkuce][kLevel],idkuce);
KucaLabel[idkuce] = Create3DTextLabel(string ,0x33CCFFAA,X,Y,Z,25,0,1);
KucaPickup[idkuce] = CreatePickup(1273, 1, KucaInfo[idkuce][kUlazX], KucaInfo[idkuce][kUlazY], KucaInfo[idkuce][kUlazZ]);
SCM(playerid,-1,""SIVA"Kuca je uspesno kreirana!"); SacuvajKucu(idkuce);
return 1;
}

Reply
#2

To convert it for ZCMD, just swap it:
Quote:

YCMD:kreirajkucu(playerid, params[],help)

for
Quote:

CMD:kreirajkucu(playerid, params[])

After doing it, remove:
Quote:

#pragma unused help

Just it
Reply
#3

Ye that INI how to change TNX Joao You will get +rep

Quote:

forward UcitajKuce(idkuce, name[], value[]);
public UcitajKuce(idkuce, name[], value[])
{
INI_Int("ProveraVlasnika",KucaInfo[idkuce][kProveraVlasnika]);
INI_String("Vlasnik",KucaInfo[idkuce][kVlasnik],45);
INI_String("Vrsta",KucaInfo[idkuce][kVrsta],35);
INI_String("Ime",KucaInfo[idkuce][kIme], 60);
INI_Float("UlazX",KucaInfo[idkuce][kUlazX]);
INI_Float("UlazY",KucaInfo[idkuce][kUlazY]);
INI_Float("UlazZ",KucaInfo[idkuce][kUlazZ]);
INI_Float("IzlazX",KucaInfo[idkuce][kIzlazX]);
INI_Float("IzlazY",KucaInfo[idkuce][kIzlazY]);
INI_Float("IzlazZ",KucaInfo[idkuce][kIzlazZ]);
INI_Int("Level",KucaInfo[idkuce][kLevel]);
INI_Int("Cena",KucaInfo[idkuce][kCena]);
INI_Int("Novac",KucaInfo[idkuce][kNovac]);
INI_Int("Interior",KucaInfo[idkuce][kInt]);
INI_Int("Zatvoreno",KucaInfo[idkuce][kZatvoreno]);
INI_Int("VW",KucaInfo[idkuce][kVW]);
INI_Int("Oruzije",KucaInfo[idkuce][kOruzije]);
INI_Int("Municija",KucaInfo[idkuce][kMunicija]);
INI_Int("Rent",KucaInfo[idkuce][kRent]);
INI_Int("CenaRenta",KucaInfo[idkuce][kCenaRenta]);
INI_Int("Zvono",KucaInfo[idkuce][kZvono]);
INI_Int("Heal",KucaInfo[idkuce][kHeal]);
INI_Int("Skin",KucaInfo[idkuce][kSkin]);
INI_Int("PromenaIntKuce",KucaInfo[idkuce][kPromenaIntKuce]);
return 1;
}
///////////////////////////////////////////////////
stock SacuvajKucu(idkuce)
{
new kFile[128];
format(kFile, sizeof(kFile), KUCE_FILE, idkuce);
new INI:File = INI_Open(kFile);
INI_WriteInt(File,"ProveraVlasnika",KucaInfo[idkuce][kProveraVlasnika]);
INI_WriteString(File,"Vlasnik",KucaInfo[idkuce][kVlasnik]);
INI_WriteString(File,"Vrsta",KucaInfo[idkuce][kVrsta]);
INI_WriteString(File,"Ime",KucaInfo[idkuce][kIme]);
INI_WriteFloat(File,"UlazX",KucaInfo[idkuce][kUlazX]);
INI_WriteFloat(File,"UlazY",KucaInfo[idkuce][kUlazY]);
INI_WriteFloat(File,"UlazZ",KucaInfo[idkuce][kUlazZ]);
INI_WriteFloat(File,"IzlazX",KucaInfo[idkuce][kIzlazX]);
INI_WriteFloat(File,"IzlazY",KucaInfo[idkuce][kIzlazY]);
INI_WriteFloat(File,"IzlazZ",KucaInfo[idkuce][kIzlazZ]);
INI_WriteInt(File,"Level",KucaInfo[idkuce][kLevel]);
INI_WriteInt(File,"Cena",KucaInfo[idkuce][kCena]);
INI_WriteInt(File,"Novac",KucaInfo[idkuce][kNovac]);
INI_WriteInt(File,"Interior",KucaInfo[idkuce][kInt]);
INI_WriteInt(File,"Zatvoreno",KucaInfo[idkuce][kZatvoreno]);
INI_WriteInt(File,"VW",KucaInfo[idkuce][kVW]);
INI_WriteInt(File,"Oruzije",KucaInfo[idkuce][kOruzije]);
INI_WriteInt(File,"Municija",KucaInfo[idkuce][kMunicija]);
INI_WriteInt(File,"Rent",KucaInfo[idkuce][kRent]);
INI_WriteInt(File,"CenaRenta",KucaInfo[idkuce][kCenaRenta]);
INI_WriteInt(File,"Zvono",KucaInfo[idkuce][kZvono]);
INI_WriteInt(File,"Heal",KucaInfo[idkuce][kHeal]);
INI_WriteInt(File,"Skin",KucaInfo[idkuce][kSkin]);
INI_WriteInt(File,"PromenaIntKuce",KucaInfo[idkuce][kPromenaIntKuce]);
INI_Close(File);
return 1;
}

Reply
#4

BUMP !!
Reply
#5

Why are you changing from YSI to other libraries? YCMD and ZCMD are both just about the same speed. I think YSI is faster when you have over 100 commands in your mode.

y_ini is (IIRC) the fastest file-based reading/writing system (except for the native file functions)- so why change?
Reply
#6

my Mod Can't Use YSI i must 70000 lines To change to YSi :@
Reply
#7

I'm assuming you mean your MODE can't use YSI? And why's that?
Reply
#8

my gamemod is GTARP , GF EDIT and i USe this Includes
Quote:

#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <zcmd>
#include <sscanf2>
#include <paused>
#include <streamer>
#include <t-Auto_Gates>
#include <utils>
#include <GetVehicleColor>
#include <morphinc>
#include <foreach>
#include <fixes>
#include <Dini>
#include <djson>
and when i add this includes

Quote:

#include <YSI\y_ini>
#include <YSI\y_commands>

All my CMDS on strcmp Don't work...
Reply
#9

BUMP! :/
Reply
#10

markoku, add skype:

joao_pedro_vasco
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)