24.08.2013, 13:35
Hello I have command which I create a checkpoint's for events but dini is slow and I want it to in yini. I want this in yini. Can you help me? Thanks
pawn Код:
CMD:utrkacp(playerid, params[])
{
if(GetPVarInt(playerid,"RaceIzrada") == 1)
{
new Float:X, Float:Y, Float:Z;
new utrkaFile[256];
new string[256], zadnjicp, Float:radius, prolaz, idcpa;
if(sscanf(params,"ifii",zadnjicp, radius, prolaz, idcpa)) return SCM(playerid, COLOR_GRAD,"{FFAF00}Koristite: {FFFFFF}/utrkacp [zadnji CP? 1-DA, 0-Ne] [radius CP-a] [PROLAZ? 1-DA, 0-Ne] [ID CP-a]");
if(zadnjicp > 1) return SCM(playerid, 0xadaeadFF," Zadnji CP krivi iznos! 1-DA, 0-NE!");
if(prolaz > 1) return SCM(playerid, 0xadaeadFF," Prolaz krivi iznos! 1-DA, 0-NE!");
if(zadnjicp < 0) return SCM(playerid, 0xadaeadFF," Zadnji CP krivi iznos! 1-DA, 0-NE!");
if(prolaz < 0) return SCM(playerid, 0xadaeadFF," Prolaz krivi iznos! 1-DA, 0-NE!");
if(idcpa > 40000) return SCM(playerid, 0xadaeadFF," Krivi id CP-a!");
if(radius > 20) return SCM(playerid, 0xadaeadFF," Krivi radius! Raspon: od 5.0 do 20.0");
if(radius < 5) return SCM(playerid, 0xadaeadFF," Krivi radius! Raspon: od 5.0 do 20.0");
format(utrkaFile, sizeof(utrkaFile),"/utrke/%s.UTRKA","Utrka nije ucitana!");
format(utrkaFile, sizeof(utrkaFile),"/utrke/%s.UTRKA", "Utrka nije ucitana!");
dini_Create(utrkaFile);
if(IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
format(string, sizeof(string),"CP_%d_PosX", idcpa), dini_FloatSet(utrkaFile, string, X);
format(string, sizeof(string),"CP_%d_PosY", idcpa), dini_FloatSet(utrkaFile, string, Y);
format(string, sizeof(string),"CP_%d_PosZ", idcpa), dini_FloatSet(utrkaFile, string, Z);
format(string, sizeof(string),"CP_%d_Prolaz", idcpa), dini_IntSet(utrkaFile, string, prolaz);
if(zadnjicp == 1)
{
dini_IntSet(utrkaFile,"Zadnji_CP", idcpa);
}
dini_FloatSet(utrkaFile,"CP_Radius", radius);
}
else
{
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string),"CP_%d_PosX", idcpa), dini_FloatSet(utrkaFile, string, X);
format(string, sizeof(string),"CP_%d_PosY", idcpa), dini_FloatSet(utrkaFile, string, Y);
format(string, sizeof(string),"CP_%d_PosZ", idcpa), dini_FloatSet(utrkaFile, string, Z);
format(string, sizeof(string),"CP_%d_Prolaz", idcpa), dini_IntSet(utrkaFile, string, prolaz);
//dini_IntSet(utrkaFile,"CP_%d_Prolaz",idcpa, idcpa);
if(zadnjicp == 1)
{
dini_IntSet(utrkaFile,"Zadnji_CP", idcpa);
}
dini_FloatSet(utrkaFile,"CP_Radius", radius);
}
new hIme[MAX_PLAYER_NAME];
RPIme(playerid,hIme);
dini_Set(utrkaFile,"Rekorder", "Nitko");
dini_IntSet(utrkaFile, "RekordMinuti", 59);
dini_IntSet(utrkaFile, "RekordSekunde", 59);
dini_IntSet(utrkaFile, "BrojCP", idcpa);
format(string, sizeof(string),"CP[%s] CPid[%d] X[%.4f] Y[%.4f] Z[%.4f] R[%.2f] Z?[%d] PR?[%d]", hIme, idcpa, X, Y, Z, radius, zadnjicp, prolaz);
SendAdminMessage(COLOR_YELLOW, string);
}
else return SendClientMessage(playerid, 0xC3C3C3FF,"{FFFFFF}[{F81414}G-Unit{FFFFFF}] {C3C3C3}ODBIJENO!");
return 1;
}