if(strcmp(cmd, "/gotocar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, ""A_G"[Comando:]"A_D" /gotocar [carid]");
return 1;
}
new testcar = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new Float:cwx2,Float:cwy2,Float:cwz2;
GetVehiclePos(testcar, cwx2, cwy2, cwz2);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, cwx2, cwy2, cwz2);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid, cwx2, cwy2, cwz2);
}
SetPlayerInterior(playerid,0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, ""A_G"[Comando:]"A_D" Non sei autorizzato ad utilizzare questo comando");
}
}
return 1;
}
if(strcmp(cmd, "/acarenter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""#A_G"[Comando:]"#A_D" /acarenter [carid]");
return 1;
}
new id = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(id != INVALID_VEHICLE_ID)
{
PutPlayerInVehicle(playerid,id,0);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Invalid Vehicle ID.");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}
if(strcmp(cmd, "/acarrandmodel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new car = GetPlayerVehicleID(playerid) - 1;
new rand = random(sizeof(RandomStableModels));
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetVehicleZAngle(vehicleid,a);
DynamicCars[car][CarModel] = RandomStableModels[rand][0];
DestroyVehicle(vehicleid);
CreateVehicle(DynamicCars[car][CarModel],x,y,z,a,DynamicCars[car][CarColor1],DynamicCars[car][CarColor2], -1);
PutPlayerInVehicle(playerid,vehicleid,0);
SaveDynamicCars();
new wstring[128];
format(wstring, sizeof(wstring), "You have set Vehicle ID: %d to a random model.", vehicleid);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Non hai selezionato un veicolo!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}
if(strcmp(cmd, "/acarpark", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new car = GetPlayerVehicleID(playerid) - 1;
new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
DynamicCars[car][CarX] = x;
DynamicCars[car][CarY] = y;
DynamicCars[car][CarZ] = z;
DynamicCars[car][CarAngle] = a;
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);
SaveDynamicCars();
new wstring[128];
format(wstring, sizeof(wstring), "You have parked Vehicle ID: %d.", vehicleid);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Non hai selezionato un veicolo!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}
if(strcmp(cmd, "/acarfaction", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /acarfaction [faction]");
return 1;
}
new thecar = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5)
{
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), "You've set Vehicle ID %d's faction to: %d.", vehicleid,thecar);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
SaveDynamicCars();
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Incorrect Faction ID, Correct Faction ID's: 1-10.");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Your not in a vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}
if(strcmp(cmd, "/acartype", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /acartype [type]");
return 1;
}
new thecar = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
new car = GetPlayerVehicleID(playerid) - 1;
new vehicleid = GetPlayerVehicleID(playerid);
DynamicCars[car][CarType] = thecar;
new wstring[128];
format(wstring, sizeof(wstring), "You've set Vehicle ID %d's type to: %d.", vehicleid,thecar);
SendClientMessage(playerid,COLOR_ADMINCMD, wstring);
SaveDynamicCars();
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Your not in a vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}
if(strcmp(cmd, "/acarmodel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /acarmodel [modelid]");
return 1;
}
new thecar = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(thecar > 399 && thecar < 612)
{
new car = GetPlayerVehicleID(playerid) - 1;
new vehicleid = GetPlayerVehicleID(playerid);
DynamicCars[car][CarModel] = thecar;
new wstring[128];
format(wstring, sizeof(wstring), "You've set Vehicle ID %d's model to: %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);
SaveDynamicCars();
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Incorrect Model ID, Correct Model ID's: 400-611.");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Your not in a vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}
if(strcmp(cmd, "/acarcolor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /acarcolor [colorid] [colorid]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 5)
{
if(IsPlayerInAnyVehicle(playerid))
{
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" 0-252 = Valid Colors."); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USAGE: /acarcolor [colorid] [colorid]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" 0-252 = Valid Colors."); return 1; }
new car = GetPlayerVehicleID(playerid) - 1;
new vehicleid = GetPlayerVehicleID(playerid);
DynamicCars[car][CarColor1] = color1;
DynamicCars[car][CarColor2] = color2;
new wstring[128];
format(wstring, sizeof(wstring), "Hai settato al veicolo ID %d I colori ID: %d-%d.", vehicleid,color1,color2);
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);
SaveDynamicCars();
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Non sei in un veicolo!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, ""A_H"[Errore:]"A_D" Non sei un amministratore!");
}
}
return 1;
}