if(strcmp(cmd, "/CriarCarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(CreatedCar >= 96)
{
SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611)
{
SendClientMessage(playerid, COLOR_GREY, " Modelo Do Carro Tem Que Ser Entre 411 e 600 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new COLOR1;
COLOR1 = strval(tmp);
if(COLOR1 < 0 || COLOR1 > 252)
{
SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new COLOR2;
COLOR2 = strval(tmp);
if(COLOR2 < 0 || COLOR2 > 252) {
SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !");
return 1;
}
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, COLOR1, COLOR2, -1);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
format(string, sizeof(string), " Veiculo %d Criado.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}
if(strcmp(cmd, "/CriarCarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(CreatedCar >= 96)
{
SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611)
{
SendClientMessage(playerid, COLOR_GREY, " Modelo Do Carro Tem Que Ser Entre 411 e 600 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new COLOR1;
COLOR1 = strval(tmp);
if(COLOR1 < 0 || COLOR1 > 252)
{
SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new COLOR2;
COLOR2 = strval(tmp);
if(COLOR2 < 0 || COLOR2 > 252) {
SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !");
return 1;
}
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, COLOR1, COLOR2, -1);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof (Nome));
format(string, sizeof(string), "O administrador %s Criou Veiculo Id: %d",Nome, carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}
Tenta ae
PHP код:
|
//Inicio do gm
new Text3D:TextCarro[MAX_VEHICLES];
if(strcmp(cmd, "/CriarCarro", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
if(CreatedCar >= 96)
{
SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611)
{
SendClientMessage(playerid, COLOR_GREY, " Modelo Do Carro Tem Que Ser Entre 411 e 600 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new COLOR1;
COLOR1 = strval(tmp);
if(COLOR1 < 0 || COLOR1 > 252)
{
SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /CriarCarro [IDCARRO] [COR1] [COR2]");
return 1;
}
new COLOR2;
COLOR2 = strval(tmp);
if(COLOR2 < 0 || COLOR2 > 252)
{
SendClientMessage(playerid, COLOR_GREY, " Nъmero Da Cor tem que ser entre 0 e 126 !");
return 1;
}
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, COLOR1, COLOR2, -1);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof (Nome));
format(string, 128, "Criado por %s\nModelo: %d\nID: %d", Nome, GetVehicleModel(carid), carid);
TextCarro[carid] = Create3DTextLabel(string, -1, 0.0, 0.0, 0.0, 15.0, 0, 1);
Attach3DTextLabelToVehicle(TextCarro[carid], carid, 0.0, 0.0, 0.0+1);
format(string, sizeof(string), " Veiculo %d Criado.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
return 1;
}