[PEDIDO] CMD para criar veiculos id e cor1 cor2
#2

pawn Код:
if(strcmp(cmd, "/cv", true) == 0)
{
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    new plid;
    new cor1, cor2;
    new Float:X,Float:Y,Float:Z,Float:Angle;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, -1, "[x] Digite: /cv [id] [cor1] [cor2]");
        return 1;
    }
    plid = strval(tmp);
    if(plid == 501 || plid == 465 || plid == 464 || plid == 441 || plid == 594 || plid == 564 || plid == 501 || plid == 432 || plid == 520 || plid == 447 || plid == 425 )
    {
        SendClientMessage(playerid, -1, "[x] Carro Proibido!!");
        return 1;
    }
    if(IsPlayerConnected(playerid))
    {
        cor1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "[x] Digite: /cv [id] [cor1] [cor2]");
            return 1;
        }
        cor2 = strval(tmp);
        if(plid >= 400 && plid <= 611)
        {
            GetPlayerPos(playerid,X,Y,Z);
            GetPlayerFacingAngle(playerid,Angle);
            new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000);
            PutPlayerInVehicle(playerid,carro,0);
            if(GetPlayerInterior(playerid))
            LinkVehicleToInterior(carro,GetPlayerInterior(playerid));
            SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld(playerid));
            ChangeVehicleColor(carro,cor1,cor2);
            format(string, sizeof(string), "[ INFO ] Veiculo de ID '%d' criado com sucesso!", plid);
            SendClientMessage(playerid, -1, string);
            return 1;
        }
        else {
            SendClientMessage(playerid, -1, "[x] ID invбlido || ID's = 400-611");
            return 1;
        }
    }
}
Reply


Messages In This Thread
[PEDIDO] CMD para criar veiculos id e cor1 cor2 - by Chis - 20.01.2012, 21:37
Re: [PEDIDO] CMD para criar veiculos id e cor1 cor2 - by dPlaYer_ - 20.01.2012, 22:11

Forum Jump:


Users browsing this thread: 1 Guest(s)