[pedido] /carro [id] em STRCMP
#1

Pessoal codigo pra cria carro com o comando
Код:
/carro [id do veiculo]
Que funcione com todos os carros
E que quando crie o carro ele ja nassa dentro do veiculo!


Alguem Me ajuda
Reply
#2

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;
}
Reply
#3

deu erro:

Код:
C:\Users\AsR\Servidores\TSD The Star Drift-DM-Race\gamemodes\tsd.pwn(881) : error 017: undefined symbol "ColocarNoVeiculo"
Reply
#4

Isso nгo tem no comando!
Reply
#5

aff

Usso o ****** Chrome
Ele traduz altomaticamente
kkkkkkkkkk
foi mal!
Reply
#6

Mas agora deu esse erro:

Код:
C:\Users\AsR\Servidores\TSD The Star Drift-DM-Race\gamemodes\tsd.pwn(870) : error 047: array sizes do not match, or destination array is too small
Linha:

Код:
    new string[128], tmp[128], idx; tmp = strtok(cmdtext, idx);
Reply
#7

pawn Код:
new string[128], tmp[256], idx; tmp = strtok(cmdtext, idx);
Tenta assim.
Reply
#8

agora funcionou!

VLW
Reply
#9

Agora vou ver se nгo esqueзo q o tamanho dessa tmp tem q ser 256. pois trabalhar com strtok й um saco. prefiro sscanf e zcmd msm. Nds...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)