[Pedido] /car ... [Cor1] [Cor2]
#10

pawn Код:
if(!strcmp(cmd, "/car"))
{
    new value[5], string[24 char];
    if(unformat(params, "s[24]iI(-1)",string,value[0],value[1]))
        return SendClientMessage(playerid, -1, "Uso: /car [veiculo] [cor 1] [cor 2]!");
    value[3] = -1;
    for(new i=0; i<sizeof(VehicleNames); i++)
    {
        if(strfind(VehicleNames[i], string, true) != -1)
        {
            value[3] = i+400;
            break;
        }
    }
    if(value[3] == -1) return SendClientMessage(playerid, COLOR_RED, "[Erro]{b4b5b7} Nome invбlido!");
    GetPlayerPos(playerid, pX,pY,pZ);
    GetPlayerFacingAngle(playerid, pA);
    if(value[1] == -1) value[1] = value[0];
    value[2] = CreateVehicle(value[3],pX,pY,pZ,pA,value[0],value[1],999999);
    LinkVehicleToInterior(value[2], GetPlayerInterior(playerid));
    SetVehicleVirtualWorld(value[2], GetPlayerVirtualWorld(playerid));
    PutPlayerInVehicle(playerid, value[2], 0);
    SendClientMessage(playerid, -1, "Veiculo criado com sucesso!");
    return 1;
}
pronto, strcmp agora, sу nгo me peзa pra fazer strtok q eu n faзo.
Reply


Messages In This Thread
[Pedido] /car ... [Cor1] [Cor2] - by Gustavo_Samp - 21.11.2011, 18:42
Re: /car ... [Cor1] [Cor2] - by .Unnamed - 21.11.2011, 18:58
Re: /car ... [Cor1] [Cor2] - by Gustavo_Samp - 21.11.2011, 19:02
Re: /car ... [Cor1] [Cor2] - by Pharrel - 21.11.2011, 19:04
Re: /car ... [Cor1] [Cor2] - by .Unnamed - 21.11.2011, 19:08
Re: /car ... [Cor1] [Cor2] - by Gustavo_Samp - 21.11.2011, 19:28
Re: /car ... [Cor1] [Cor2] - by Pharrel - 21.11.2011, 19:30
Re: /car ... [Cor1] [Cor2] - by .Unnamed - 21.11.2011, 19:33
Re: /car ... [Cor1] [Cor2] - by Gustavo_Samp - 21.11.2011, 19:35
Re: /car ... [Cor1] [Cor2] - by Pharrel - 21.11.2011, 19:35

Forum Jump:


Users browsing this thread: 1 Guest(s)