Convert ZCMD to strcmd
#2

pawn Код:
if(strcmp(cmdtext, "/vsetcolor", true, 10) == 0)
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be admin to use this command!");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to change its color!");

    new
        vColors[2],
        iMsg[65],
        ivID = GetPlayerVehicleID(playerid);

    if(sscanf(params, "ii", vColors[0], vColors[1])) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/vSetColor < Color1 > < Color2 >");

    if(OwnedVeh(ivID) != 0)
    {
        ChangeVehicleColor(OwnedVeh(ivID), vColors[0], vColors[1]);

        vehicleinfo[OwnedVeh(ivID)][vColor1] = vColors[0];
        vehicleinfo[OwnedVeh(ivID)][vColor2] = vColors[1];

        format(iMsg, sizeof(iMsg), ""#CDGREEN"You've set this vehicle's color to: "#CBLUE"%i - %i", vColors[0], vColors[1]);
        SendClientMessage(playerid, -1, iMsg);

        SavePrivVeh(OwnedVeh(ivID));
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "This is not a buyable vehicle!");
}
Reply


Messages In This Thread
Convert ZCMD to strcmp - by lewismichaelbbc - 06.06.2012, 15:13
Re: Convert ZCMD to strcmd - by sniperwars - 06.06.2012, 15:16
Re: Convert ZCMD to strcmd - by lewismichaelbbc - 06.06.2012, 15:27
Re: Convert ZCMD to strcmd - by ricardo178 - 06.06.2012, 16:24
Re: Convert ZCMD to strcmd - by lewismichaelbbc - 06.06.2012, 16:25
Re: Convert ZCMD to strcmd - by San1 - 06.06.2012, 16:26
Re: Convert ZCMD to strcmd - by MadeMan - 06.06.2012, 17:22

Forum Jump:


Users browsing this thread: 1 Guest(s)