02.03.2012, 20:58
Hello,i was doing system for dynamic making trucking missions.
I don't know how to "convert" this from dini to y_ini,i don't know how to finish this command (cmd:end)
If you need help with translating to english,i will translate it.
Sorry for my bad english..
I don't know how to "convert" this from dini to y_ini,i don't know how to finish this command (cmd:end)
Код:
#include <a_samp> #include <zcmd> #include <sscanf2> #include <dini> #include <YSI/y_ini> #define SCM SendClientMessage #define MAX_MISIJA 250 enum mInfo { Start:X, Start:Y, Start:Z, Zarada, KrajX, KrajZ, KrajY, Poceo, } enum pInfo { pAdmin, } new Misija[MAX_PLAYERS][mInfo]; new PlayerInfo[MAX_PLAYERS][pInfo]; CMD:mission(playerid,params[]) { new zarada; if(!PlayerInfo[playerid][pAdmin] >= 5) return SCM(playerid,-1,"You are not Admin Level 5!"); if(Misija[playerid][Poceo] == 1) return SCM(playerid,-1,"You are doing mission!"); if(sscanf(params, "i", zarada)) return SendClientMessage(playerid, -1, "Use: /mission [earning]"); if(zarada < 1 || zarada > 15000) return SCM(playerid,-1,"Earning can't be less than 1 and more than 15000$"); new Misije[64],Float:X, Float:Y, Float:Z; format(Misije, sizeof(Misije), "/Misije/Truck/%d.ini.save", NextMisijeID); new NextMisijeID = SljedeciNekoristeniIDMisije(); GetPlayerPos(playerid,X,Y,Z); if(!dini_Exists(Misije)){ dini_Create(Misije); dini_IntSet(Misije, "Zarada", zarada); dini_FloatSet(Misije,"Start:X", X); dini_FloatSet(Misije,"Start:Y", Y); dini_FloatSet(Misije,"Start:Z", Z); LoadPlayerMisije(NextMisijeID); } Misija[playerid][Poceo] = 1; SendClientMessage(playerid,-1,"Napravili ste mjesto pocetka rute i zaradu,krenite na mjesto gdje zelite postaviti kraj rute"); return true; } CMD:kraj(playerid,params[]) { if(!PlayerInfo[playerid][pAdmin] >= 5) return SCM(playerid,-1,"Niste Administrator Level 5!") if(!Misija[playerid][Poceo] == 1) return SCM(playerid,-1,"Niste niti zapoceli misiju"); new Float:X, Float:Y, Float:Z,zarada; GetPlayerPos(playerid, X, Y, Z); Misija[playerid][Kraj:X] = X; Misija[playerid][Kraj:Y] = Y; Misija[playerid][Kraj:Z] = Z; SendClientMessage(playerid,-1,"Postaviti ste kraj rute"); Misija[playerid][Poceo] = 0; return true; } stock SljedeciNekoristeniIDMisije() { new Misije[64]; for(new ms = 0; ms <= MAX_MISIJA; ms++){ format(Misije, sizeof(Misije), "/Misije/Truck/%d.ini.save", ms); if(!dini_Exists(Misije)) return ms; } return true; }
Sorry for my bad english..