02.09.2012, 19:12
How i can make that command's to "read" faster
When i use them it's an 5-10 seconds lag delay
pawn Код:
if (strcmp(cmd, "/buyveh", true) ==0 )
{
if(dini_Int(PFile(playerid),"HaveCar")== 1) return SendClientMessage(playerid,ORANGE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} {FF0000}[ERROR]{FFFFFF} Tu Ai Deja O masina Cumparata!");
format(string,sizeof(string),"GameFrontPCars/Users/%s.ini",tmp);
dini_Remove(string);
if(!IsPlayerInAnyVehicle(playerid)){return 1;}
if(GetCreatorID(vehicleid)!=0)
{
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid))){SendClientMessage(playerid,WHITE," {3BB9FF}[GAMEFRONT]:{FFFFFF} Aceasta masina este deja cumparata!");return 1;}
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar"))
{
if(VehicleSystem[GetCreatorID(vehicleid)][preis] < GetPlayerMoney(playerid))
{
strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid),0,128,128);
VehicleSystem[GetCreatorID(vehicleid)][owned]=1;
SetVehicleNumberPlate(vehicleid, VehicleSystem[GetCreatorID(vehicleid)][owner]);
GivePlayerMoney(playerid,-VehicleSystem[GetCreatorID(vehicleid)][preis]);
SendClientMessage(playerid,YELLOW," {3BB9FF}[GAMEFRONT]:{FFFFFF} Felicitari pentru noua achizitie!");
SendClientMessage(playerid,WHITE," {3BB9FF}[GAMEFRONT]:{FFFFFF} Poti vedea comenzile la masina utilizand comanda {3BB9FF}/carhelp");
TogglePlayerControllable(playerid,1);
SaveTool();
Carlabel(playerid);
}
else
{
SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} Ai nevoie de mai multi bani!");
}
}
else
{
SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} Aceasta masina nu e de vanzare!");
}
}
else
{
SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} Nu e de vanzare!");
}
if(!dini_Exists(PFile(playerid)))
{
dini_Create(PFile(playerid));
dini_IntSet(PFile(playerid),"HaveCar",1);
dini_IntSet(PFile(playerid),"CarID",vehicleid);
}
else if(dini_Exists(PFile(playerid)))
{
dini_IntSet(PFile(playerid),"HaveCar",1);
dini_IntSet(PFile(playerid),"CarID",vehicleid);
}
return 1;
}
pawn Код:
if (strcmp(cmd, "/sellveh", true) ==0)
{
if(!IsPlayerInAnyVehicle(playerid)){return 1;}
if(GetCreatorID(vehicleid)!=0)
{
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)){SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} INFO: /sellveh [pret]");return 1;}
new Float:vx,Float:vy,Float:vz,Float:va;
GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
VehicleSystem[GetCreatorID(vehicleid)][x]=vx;
VehicleSystem[GetCreatorID(vehicleid)][y]=vy;
VehicleSystem[GetCreatorID(vehicleid)][z]=vz;
VehicleSystem[GetCreatorID(vehicleid)][a]=va;
VehicleSystem[GetCreatorID(vehicleid)][preis]=strval(tmp);
VehicleSystem[GetCreatorID(vehicleid)][owned]=0;
strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar",0,128,128);
SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} Aceasta masina e acum de vanzare!");
SaveTool();
Carlabel(playerid);
format(string,sizeof(string),"GameFrontPCars/Users/%s.ini",tmp);
dini_Remove(string);
}
else
{
SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} INFO: Nu poti vinde masina asta,nu este ata!");
}
}
return 1;
}
pawn Код:
if (strcmp(cmd, "/park", true) ==0 )
{
if(!IsPlayerInAnyVehicle(playerid)){return 1;}
if(GetCreatorID(vehicleid)!=0)
{
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
{
new Float:vx,Float:vy,Float:vz,Float:va;
GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
VehicleSystem[GetCreatorID(vehicleid)][x]=vx;
VehicleSystem[GetCreatorID(vehicleid)][y]=vy;
VehicleSystem[GetCreatorID(vehicleid)][z]=vz;
VehicleSystem[GetCreatorID(vehicleid)][a]=va;
SetVehicleHealth(GetPlayerVehicleID(playerid),100.0);
SendClientMessage(playerid,WHITE,"{3BB9FF}[GAMEFRONT]:{FFFFFF} Masina a fost parcata aici!");
SendClientMessage(playerid,YELLOW,"{3BB9FF}[GAMEFRONT]:{FFFFFF} Masina se va respawna aici!");
SaveTool();
}
}
return 1;
}