if(strcmp(cmd, "/criarveiculo", true) == 0 || strcmp(cmd, "/cv", true)==0){
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "Uso: /criarveiculo [id / veнculo] [cor1] [cor2]");
return 1;
}
new veiculo = GetVehicleModelID(tmp);
if(veiculo == -1)
{
veiculo = strval(tmp);
if(veiculo < 400 || veiculo > 611)
{
SendClientMessage(playerid, COLOR_RED, "| ERRO | Vocк sу pode criar veнculo com ID de 400 б 611");
return 1;
}
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "| INFO | Uso: /criarveiculo [id / veнculo] [cor1] [cor2]");
return 1;
}
new cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "| INFO | Uso: /criarveiculo [id / veнculo] [cor1] [cor2]");
return 1;
}
new Float:pa;
new cor2 = strval(tmp);
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid, pa);
px += (5 * floatsin(-pa, degrees));
py += (5 * floatcos(-pa, degrees));
vehid = CreateVehicle(veiculo, px, py, pz, 0.0, cor1, cor2, 6400);
format(string, sizeof(string), "| INFO | Veнculo id: %s criado com sucesso!", Veiculos[GetVehicleModel(vehid)-400]);
SendClientMessage(playerid, COLOR_GREEN, string);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
PutPlayerInVehicle(playerid, vehid, 0);
return 1;
}
if(strcmp("/criarveh", cmdtext, true, 9) == 0) {
new Float:x,Float:y,Float:z;
new vehcriar[256];
new vehcor[256];
new vehcor2[256];
vehcor = KcmD(2, cmdtext);
vehcor2 = KcmD(3, cmdtext);
vehcriar = KcmD(1, cmdtext);
if(!strlen(vehcriar)) {
SendClientMessage(playerid,cor_verde,"USE: /criarveh [ID][COR 1][COR 2]");
return 1;
}
if(!strlen(vehcor)) {
SendClientMessage(playerid,cor_verde,"USE: /criarveh [ID][COR 1][COR 2]");
return 1;
}
if(!strlen(vehcor2)) {
SendClientMessage(playerid,cor_verde,"USE: /criarveh [ID][COR 1][COR 2]");
return 1;
}
GetPlayerPos(playerid, x,y,z);
CreateVehicle(strval(vehcriar),x,y,z,0,strval(vehcor),strval(vehcor2),0);
return 1;
}
fiz agora
pawn Код:
|
if(strcmp(cmd, "/veiculo", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
}
new ID;
ID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
}
new Cor1;
Cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid, 0xFF0000AA, "USO: /veiculo [ID] [COR 1] [COR 2]");
}
new Cor2;
Cor2 = strval(tmp);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(ID, X+2, Y, Z, 0.0, Cor1, Cor2, 60000);
return SendClientMessage(playerid,0x00FF00AA,"Veiculo Criado");
}