08.03.2012, 20:48
pawn Код:
if(!strcmp(cmdtext, "/carro", true))
{
new string[128], tmp[128], idx; tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
return SendClientMessage(playerid, COR_CINZA, "Use /carro [id do veiculo]");
new car = strval(tmp);
if(car < 400 || car > 611)
return SendClientMessage(playerid, COR_VERMELHO, "ERRO: O nъmero do veнculo deve ser de 400 а 611.");
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X, Y, Z, 0.0, 0, 0, -1);
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, carid, 0);
format(string, sizeof(string), "Veнculo %d, criado.", carid);
SendClientMessage(playerid, -1, string);
return 1;
}