ZCMD: /aveh [vehicle id] [color1] [color2] ???
#6

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
pawn Код:
CMD:aveh(playerid, params[])
{
        if(!IsPlayerAdmin(playerid)) return 0; //same as that client message you made
    if(isnull(params)) return Usage(playerid, "/car [model]");

    new veh, col[2];
    new tmp[32],string[148];

    if(sscanf(params, "s[32]I(-1)I(-1)", tmp, col[0], col[1])) return SendClientMessage(playerid, COLOR_RED, "/aveh [model] [color] [color]");

    if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid,COLOR_RED, "vehcile IDs between 400 - 611!");
    if(col[0] || col[1] > 255 || col[0] || col[1]< 0) return SendClientMessage(playerid, 0xFFFFFF, "Car color ID's: 0-255");

    new Float:cPos[4];

    GetPlayerPos(playerid, cPos[0], cPos[1], cPos[2]);
    GetPlayerFacingAngle(playerid, cPos[3]);

    CreateVehicle(vehicle, cPos[0], cPos[1]-3, cPos[2], cPos[3], col[0], col[1], -1);
    return 1;
}
try that
You need to look at tutorials on zcmd/sscanf, seriously.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)