Gente sou novo em pawno e agr passei meu gm pra zcmd mas porem tem um comando que с consigui se poderem me ajudar eu agradeзo.
Код:
new
vModel,
Float:ppos[3],
VeiculoID[MAX_PLAYERS]
gstring[256]
;
new Veiculos[212][] =
{
(isso iria ocupar muito espaso sгo os nome dos carros)
{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},{"Utility Trailer"}
};
public OnPlayerConnect(playerid)
{
VeiculoID[playerid] = -1;
return 1;
}
public OnPlayerDisconnect(playerid)
{
DestroyVehicle(VeiculoID[playerid]);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
new string[256];
cmd = strtok(cmdtext, idx);
//========== carros por v
new
tmp[128];
GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/criarveiculo", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF3300AA, "| ERRO | Uso correto: /v [id veнculo] [cor1] [cor2]");
return 1;
}
new
veiculo = strval(tmp);
if(veiculo < 400 || veiculo > 611)
{
SendClientMessage(playerid, 0xFF3300AA, "| ERRO | Somente veнculos entre os ID: 400 б 611");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF3300AA, "| ERRO | Uso correto: /v [id veнculo] [cor1] [cor2]");
return 1;
}
new
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
new
color2 = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF3300AA, "| ERRO | Uso correto: /v [id veнculo] [cor1] [cor2]");
return 1;
}
DestroyVehicle(VeiculoID[playerid]);
vModel = CreateVehicle(veiculo, ppos[0], ppos[1], ppos[2], 360, color1, color2, -1);
PutPlayerInVehicle(playerid, vModel, 0);
VeiculoID[playerid] = GetPlayerVehicleID(playerid);
return 1;
}
stock GetVehicleModelID(nome[])
{
for(new i = 0; i < 211; ++i)
{
if(strfind(Veiculos[i], nome, true) != -1) return i + 400;
}
return -1;
}
stock PlayerName(playerid)
{
new
PvName[MAX_PLAYER_NAME+1]
;
GetPlayerName(playerid, PvName, sizeof(PvName));
return PvName;
}