Sign in to follow this  
xSony

[Tutorial] Cum sa faci un sistem vip?

3 posts in this topic

*

    Credite: EquiNox.

    Facut de EquiNox.

*/

 

#include <YSI\y_hooks>

 

#define DIALOG_VIP_WHEELS 827

#define DIALOG_VIPCOLOR 825

 

CMD:vip(playerid, params[])

{

    if(playerVariables[playerid][pPremium] != 2) return SS(playerid, COOL_GREEN, "You must be a VIP user to use this command.", "Trebuie sa fii un membru VIP pentru a folosi aceasta comanda.");

    if(isnull(params)) return SCM(playerid, COLOR_GREY, "Usage: {FFFFFF}/vip [text]");

    format(szMessage, sizeof(szMessage), "* VIP %s: %s", GetName(playerid), params);

    submitToVIP(szMessage, COLOR_OWNER);

    return 1;

}

 

CMD:vipwheels(playerid, params[])

{

    if(!IsPlayerInAnyVehicle(playerid)) return SS(playerid, COOL_GREEN, "You must be in your owned vehicle to use this command.", "Trebuie sa te aflii intr-o masina detinuta de tine pentru a folosi aceasta comanda.");

    new vid = GetVID(GetPlayerVehicleID(playerid));

    if(vehicleVariables[vid][vVehicleOwnerID] != playerVariables[playerid][pInternalID]) return SS(playerid, COOL_GREEN, "You must be in your owned vehicle to use this command.", "Trebuie sa te aflii intr-o masina detinuta de tine pentru a folosi aceasta comanda.");

    if(vehicleVariables[vid][vPremium] == 0) return SS(playerid, COOL_GREEN, "Your vehicle must be a VIP vehicle.", "Masina ta trebuie sa fie VIP.");

    ShowPlayerDialog(playerid, DIALOG_VIP_WHEELS, DIALOG_STYLE_LIST, "VIP: Wheels", "Dollar Wheels\nOff Road\nSwitch", "Select", "Cancel");

    return 1;

}

 

CMD:vipcolor(playerid, params[])

{

    if(playerVariables[playerid][pPremium] < 2) return SCM(playerid, COOL_GREEN, "You are not a premium user.");

    ShowPlayerDialog(playerid, DIALOG_VIPCOLOR, DIALOG_STYLE_LIST, "SERVER: Vip Colors:" , "{FFD738}VIP" , "Select" , "Cancel");

    return 1;

}

 

hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

    if(dialogid == DIALOG_VIP_WHEELS)

    {

        if(response)

        {

            switch(listitem)

            {

                case 0: //Dollar

                {

                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1083);

                    SS(playerid, COLOR_ADMCMD, "VIP: Wheels have been set to Dollar", "VIP: Rotile au fost setate pe Dollar");

                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);

                }

                case 1: //Off Road

                {

                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1025);

                    SS(playerid, COLOR_ADMCMD, "VIP: Wheels have been set to Off Road", "VIP: Rotile au fost setate pe Off Road");

                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);

                }

                case 2: //Switch

                {

                    AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);

                    SS(playerid, COLOR_ADMCMD, "VIP: Wheels have been set to Switch", "VIP: Rotile au fost setate pe Switch");

                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);

                }

            }

        }

    }

    if(dialogid == DIALOG_VIPCOLOR)

    {

        if(response)

        {

            switch(listitem)

            {

                case 0:

                {

                    playerVariables[playerid][pColor] = 10;

                    SCM(playerid, COLOR_WHITE,"{FFD738}Server: {ffffff}Nick color changed! Hope you like the new color!");

                }

            }

        }

    }

    return 1;

}

 

stock submitToVIP(string[], color)

{

    for(new i; i < MAX_PLAYERS; i++)

    {

        if(playerVariables[pPremium] == 2) SCM(i, color, string);

    }

    return 1;

}

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this