24.04.2012, 19:16
Ola malta,eu estou tendo um problema que й o seguinte, quando uso um destes cmds
ou
e
knd uso qualquer cmd em um carro,akilo gera um lag ou break. Gera um break de 20 a 60 segundos nгo sei porque podemme ajudar? (Nгo tenho host ainda,й tudo no meu pc )
pawn Код:
if(strcmp(cmd, "/acarmodel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando]: /acarmodel [modelid]");
return 1;
}
new thecar = strval(tmp);
new Float:PosXX, Float:PosYY, Float:PosZZ;
GetVehicleVelocity(GetPlayerVehicleID(playerid), PosXX, PosYY, PosZZ);
if (PlayerInfo[playerid][mstrvbcAdmin] >= 22)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(thecar > 400 && thecar < 612)
{
new IDVeiculo = GetPlayerVehicleID(playerid);
for(new x = 0; x < sizeof(ShopCar); x++)
{
if(IDVeiculo == ShopCar[x])
{
Car[IDVeiculo][CarModel] = thecar;
}
}
new car = GetPlayerVehicleID(playerid) - 1;
new vehicleid = GetPlayerVehicleID(playerid);
DynamicCars[car][CarModel] = thecar;
new wstring[128];
format(wstring, sizeof(wstring), "Tu escolheste o veiculo ID %d e alteras-te o modelo: %d.", vehicleid,thecar);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(vehicleid,cx,cy,cz);
new Float:angle;
GetVehicleZAngle(vehicleid, angle);
DestroyVehicle(vehicleid);
CreateVehicle(DynamicCars[car][CarModel],DynamicCars[car][CarX],DynamicCars[car][CarY],DynamicCars[car][CarZ],DynamicCars[car][CarAngle],DynamicCars[car][CarColor1],DynamicCars[car][CarColor2], -1);
PutPlayerInVehicle(playerid,vehicleid,0);
SetVehiclePos(vehicleid, cx, cy, cz);
SetVehicleZAngle(vehicleid, angle);
LoadComponents(vehicleid);
SaveDynamicCars();
if(EngineStatus[GetPlayerVehicleID(playerid)] == 1)
{
SetVehicleEngineOn(GetPlayerVehicleID(playerid));
}
if(LuzesStatus[GetPlayerVehicleID(playerid)] == 1)
{
SetVehicleLightsOn(GetPlayerVehicleID(playerid));
}
if(vehicleid <= 10)
{
format(string, sizeof(string), "0%d-%s-%d", vehicleid, MatriculasNames[vehicleid], vehicleid+15);
SetVehicleNumberPlate(vehicleid,string);
}
else if(vehicleid <= 100 && vehicleid >= 10)
{
format(string, sizeof(string), "%d-%s-%d", vehicleid, MatriculasNames[vehicleid], vehicleid+15);
SetVehicleNumberPlate(vehicleid,string);
}
else
{
format(string, sizeof(string), "%d-%s-%d", vehicleid-100, MatriculasNames[vehicleid], vehicleid-85);
SetVehicleNumberPlate(vehicleid,string);
}
SetVehicleVelocity(GetPlayerVehicleID(playerid), PosXX, PosYY, PosZZ);
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Incorrecto Modelo ID, Model ID's: 400-611.");
}
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:]Nгo estas dentro de um veiculo!");
}
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo tens nivel suficiente para usufruires deste comando.");
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/acarfaction", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando]: /acarfaction [faction]");
return 1;
}
new thecar = strval(tmp);
if (PlayerInfo[playerid][mstrvbcAdmin] >= 21)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(thecar < 11|| 255)
{
new car = GetPlayerVehicleID(playerid) - 1;
new vehicleid = GetPlayerVehicleID(playerid);
DynamicCars[car][FactionCar] = thecar;
new wstring[128];
format(wstring, sizeof(wstring), "Tu escolheste o veiculo ID %d's para a faction: %d.", vehicleid,thecar);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
SaveDynamicCars();
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Incorrecta faciton ID, Faction ID's: 1-10.");
}
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo tens nivel suficiente para usufruires deste comando.");
}
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo tens nivel suficiente para usufruires deste comando.");
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/acartype", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTORANGE, "[Comando]: /acartype [tipo]");
return 1;
}
new thecar = strval(tmp);
if (PlayerInfo[playerid][mstrvbcAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(Car[GetPlayerVehicleID(playerid)][Owned] == 1)
{
return 1;
}
new car = GetPlayerVehicleID(playerid) - 1;
new vehicleid = GetPlayerVehicleID(playerid);
DynamicCars[car][CarType] = thecar;
new wstring[128];
format(wstring, sizeof(wstring), "Tu escolheste o veiculo ID %d's para o tipo: %d.", vehicleid,thecar);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
SaveDynamicCars();
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo estas dentro de um veiculo.");
}
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "[ERRO:] Nгo tens nivel suficiente para usufruires deste comando.");
}
}
return 1;
}