02.10.2017, 04:54
Hey guys how can i change miЎy code to zcmd?
Also can u explaint me please? cuz i read a guide but i still understand
PHP код:
if(strcmp(cmd, "/veh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GRAD, "You are not authorized to use that command!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD, "USAGE: /veh [Car ID] [Color ID 1] [Color ID 2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GRAD, " Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD, "USAGE: /veh [Car ID] [Color ID 1] [Color ID 2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GRAD, " Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [Car ID] [Color ID 1] [Color ID 2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 255) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 or above 255 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X+4,Y,Z, 0.0, color1, color2, 12000);
CreatedCars[CreatedCar] = carid;
PutPlayerInVehicle(playerid, carid, 0);
CreatedCar ++;
format(string, sizeof(string), " Vehicle %d spawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}
if(strcmp(cmd, "/addcomponent", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] > 3)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /addcomponent [ComponentID]");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a vehicle!");
return 1;
}
{
new componentid;
componentid = strval(tmp);
new CarId = GetPlayerVehicleID(playerid);
if(componentid < 1000 || componentid > 1193) { SendClientMessage(playerid, COLOR_GREY, " Component ID can't be below 1000 or above 1193 !"); return 1; }
AddVehicleComponent(CarId, componentid);
SendClientMessage(playerid, COLOR_GREEN, " Type /carcomponents for more info!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREEN, " You are not an Admin.");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/carcomponents", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] > 3)
{
SendClientMessage(playerid, COLOR_WHITE, " Car Components List");
SendClientMessage(playerid, COLOR_GREEN, " Transfenders spoilers - 1000 - 1003");
SendClientMessage(playerid, COLOR_GREEN, " Roof - 1006");
SendClientMessage(playerid, COLOR_GREEN, " x10 Nos - 1010");
SendClientMessage(playerid, COLOR_GREEN, " Shadow Rims - 1073");
SendClientMessage(playerid, COLOR_GREEN, " Mega Rims - 1074");
SendClientMessage(playerid, COLOR_GREEN, " Rimshine Rims- 1075");
SendClientMessage(playerid, COLOR_GREEN, " Wires Rims - 1076");
SendClientMessage(playerid, COLOR_GREEN, " Classic Rims - 1077");
SendClientMessage(playerid, COLOR_GREEN, " Twist Rims - 1078");
SendClientMessage(playerid, COLOR_GREEN, " Cutter Rims - 1079");
SendClientMessage(playerid, COLOR_GREEN, " Switch Rims - 1080");
SendClientMessage(playerid, COLOR_GREEN, " Grove Rims - 1081");
SendClientMessage(playerid, COLOR_GREEN, " Import Rims - 1082");
SendClientMessage(playerid, COLOR_GREEN, " Dollar Rims - 1083");
SendClientMessage(playerid, COLOR_GREEN, " Trance Rims - 1084");
SendClientMessage(playerid, COLOR_GREEN, " Atomic Rims - 1085");
SendClientMessage(playerid, COLOR_GREEN, " Hydraulics - 1087");
SendClientMessage(playerid, COLOR_GREEN, " Uranus Spoiler - 1063 - 1064");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, " You are not an Admin.");
return 1;
}
}
return 1;
}