Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined VIP
- VIP SISTEM BY sTaRxD_
- Date on 2012
- #endif
- //=======================
- #include <a_samp>
- #include <dini>
- #include <dudb>
- #include <zcmd>
- #include <sscanf2>
- //=======================
- #pragma unused ret_memcpy
- //======================
- #define vip_file "vipacount/user/%s.ini"
- #define vid GetPlayerVehicleID(playerid)
- //==================================
- enum vinfo
- {
- viplevel,
- }
- new vipinfo[MAX_PLAYERS][vinfo];
- new plogin[MAX_PLAYERS];
- new SV[MAX_PLAYERS];
- //================================
- public OnPlayerText(playerid, text[])
- {
- if(vipinfo[playerid][viplevel] >= 1)
- {
- new viptext[128];
- format(viptext, 128, "{0049FF}[%d]{0049FF}[V] {FFFFFF}%s", playerid, text);
- SendPlayerMessageToAll(playerid, viptext);
- return 0;
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- plogin[playerid] = 0;
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), "vipacount/user/%s.ini" , name);
- if (!dini_Exists(file))
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}register!", "{6EF83C}Introdu parola pentru contu tau de {F81414}vip\n{6EF83C}O sa fie nevoie sa te loghiezi dupa ce iesi de pe server", "Register", "Leave");
- }
- if(fexist(file))
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{6EF83C}Introdu parola pentru a te putea loga", "Login", "Leave");
- }
- return 1;
- }
- CMD:vipcmds(playerid, params[])
- {
- new BigString[1900];
- strcat(BigString, "{F81414}Level {FFFFFF}1\n", 1900 );
- strcat(BigString, "{6EF83C}/vipgod\n", 1900 );
- strcat(BigString, "{6EF83C}/vskin\n", 1900 );
- strcat(BigString, "{6EF83C}/vcar\n\n", 1900 );
- strcat(BigString, "{F81414}Level {FFFFFF}2\n", 1900 );
- strcat(BigString, "{6EF83C}/viphouse\n", 1900 );
- strcat(BigString, "{6EF83C}/vipmoney\n", 1900 );
- strcat(BigString, "{6EF83C}/vipscore\n\n", 1900 );
- strcat(BigString, "{F81414}Level {FFFFFF}3\n", 1900 );
- strcat(BigString, "{6EF83C}/vipann\n", 1900 );
- strcat(BigString, "{6EF83C}/vipdisarm\n", 1900 );
- strcat(BigString, "{6EF83C}/vipgoto\n", 1900 );
- ShowPlayerDialog(playerid, 90, DIALOG_STYLE_MSGBOX, "VipCommands", BigString, "-->oK<--","");
- PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
- return 1;
- }
- CMD:vipscore(playerid, params[])
- {
- new score;
- if(plogin[playerid] == 1)
- {
- if (sscanf(params, "ii",score)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipscore {F81414}[score]");return 1;}
- if(score > 1000000000)if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");return 1;}
- SetPlayerScore(playerid, score);
- }
- return 1;
- }
- CMD:viphouse(playerid, params[])
- {
- if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
- SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083);
- SetPlayerInterior(playerid,12);
- return 1;
- }
- CMD:vcar(playerid, params[])
- {
- if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
- new Float:X,Float:Y,Float:Z,Float:ppp;
- GetPlayerPos(playerid,X,Y,Z);
- GetPlayerFacingAngle (playerid,ppp);
- SetVehicleNumberPlate(SV[playerid] = CreateVehicle(432,X,Y,Z,ppp,-1,-1,60), "{00C0FF}VIP");
- PutPlayerInVehicle(playerid,SV[playerid],0);
- return 1;
- }
- CMD:vipgoto(playerid, params[])
- {
- new
- id,
- Float:x,
- Float:y,
- Float:z,
- vint,
- str[128],
- Name1[MAX_PLAYER_NAME],
- Name2[MAX_PLAYER_NAME];
- if (sscanf(params, "u", id)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
- else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Playerul nu este");
- if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!"); return 1;}
- else
- {
- if(IsPlayerInAnyVehicle(playerid) == 1)
- {
- GetPlayerPos(id, x , y , z);
- SetVehiclePos(vid, x , y , z);
- GetPlayerName(id, Name1, sizeof(Name1));
- GetPlayerName(playerid, Name2, sizeof(Name2));
- format(str, sizeof(str), "{FFFFFF}Vip: {00C0FF}%s {FFFFFF}sa teleportat la {00C0FF}%s ",Name2,Name1);
- SendClientMessageToAll(0x38FF06FF, str);
- printf(str);
- }
- else
- {
- vint = GetPlayerInterior(id);
- SetPlayerInterior(playerid, vint);
- GetPlayerPos(id, x , y , z);
- SetPlayerPos(playerid, x , y , z);
- GetPlayerName(id, Name1, sizeof(Name1));
- GetPlayerName(playerid, Name2, sizeof(Name2));
- format(str, sizeof(str), "{FFFFFF}Vip: {00C0FF}%s {FFFFFF}sa teleportat la {00C0FF}%s ",Name2,Name1);
- SendClientMessageToAll(0x38FF06FF, str);
- printf(str);
- return 1;
- }
- }
- return 1;
- }
- CMD:vipgod(playerid, params[])
- {
- new viata;
- if(plogin[playerid] == 1)
- {
- if (sscanf(params, "ii",viata)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
- if(viata > 9999999999)
- if(vipinfo[playerid][viplevel] < 1){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipgod {F81414}[Viata]");return 1;}
- SetPlayerHealth(playerid, viata);
- }
- return 1;
- }
- CMD:vipmoney(playerid, params[])
- {
- new bani;
- if(plogin[playerid] == 1)
- {
- if (sscanf(params, "ii",bani)){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipmoney {F81414}[suma]");return 1;}
- if(bani > 1000000000)if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");return 1;}
- GivePlayerMoney(playerid, bani);
- }
- return 1;
- }
- CMD:vskin(playerid, params[])
- {
- new skin;
- if(sscanf(params, "i", skin)) return SendClientMessage(playerid, -1, "{FFFFFF}/vskin {F81414}[skin id]");
- if(skin > 299 || skin < 0) return SendClientMessage(playerid, -1,"{FFFFFF}Nu exista skinu {F81414}ID!");
- if(vipinfo[playerid][viplevel] < 1) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}1 {FFFFFF}pentru aceasta comanda!");
- SetPlayerSkin(playerid, skin);
- return 1;
- }
- CMD:vipann(playerid, params[])
- {
- new
- string[128],
- string2[128];
- if (sscanf(params, "s",string2)) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipann {F81414}[TEXT]");
- if(vipinfo[playerid][viplevel] < 3) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!");
- format(string, sizeof(string),"%s", string2);
- GameTextForAll(string,5000,3);
- printf("Vip:");
- printf(string2);
- return 1;
- }
- CMD:vips(playerid, params[])
- {
- #pragma unused params
- if(IsPlayerConnected(playerid))
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new string[128],sendername[MAX_PLAYER_NAME];
- GetPlayerName(i, sendername, sizeof(sendername));
- if(vipinfo[i][viplevel] >= 0)
- {
- new vlevel[64];
- if(vipinfo[playerid][viplevel] == 0) { vlevel = "Rank"; }
- if(vipinfo[playerid][viplevel] == 1) { vlevel = "{FFFFFF}Vip Junior{00C0FF}[1]{FFFFFF}"; }
- else if(vipinfo[playerid][viplevel] == 2) { vlevel = "{FFFFFF}Vip Gold{00C0FF}[2]{FFFFFF}"; }
- else if(vipinfo[playerid][viplevel] == 3) { vlevel = "{FFFFFF}Vip premium{00C0FF}[3]{FFFFFF}"; }
- format(string, sizeof(string), "{FFFFFF}%s - %s", vlevel, sendername);
- ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_MSGBOX, "{00C0FF}Vips", string, "-->oK<--", "");
- }
- }
- }
- }
- return 1;
- }
- CMD:vipdisarm(playerid, params[])
- {
- new
- id;
- if (sscanf(params, "u", id)) SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}/vipdisarm {F81414}[playerid]");
- else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}Pleyrul nu este conectat");
- if(playerid == id) return SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}ERROR: Nu poti sa te dezarmezi pe tine!");
- if(vipinfo[playerid][viplevel] < 3){SendClientMessage(playerid, 0x38FF06FF, "{FFFFFF}[Error]: Nu ai vip level {F81414}3 {FFFFFF}pentru aceasta comanda!"); return 1;}
- else
- {
- ResetPlayerWeapons(id);
- SendClientMessage(id,0x38FF06FF, "{FFFFFF}Vip tea dezarmat!");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new file[256];
- new string[128];
- if (dialogid == 1)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), "vipacount/user/%s.ini", name);
- if(!response) return Kick(playerid);
- if (!strlen(inputtext)) return
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}register!", "{6EF83C}Introdu parola pentru contu tau de {F81414}vip\n{6EF83C}O sa fie nevoie sa te loghiezi dupa ce iesi de pe server", "Register", "Leave");
- dini_Create(file);
- dini_IntSet(file, "Password", udb_hash(inputtext));
- dini_IntSet(file, "vipLevel",vipinfo[playerid][viplevel] = 0);
- format(string, 128, "{FFFFFF}Nume: {00C0FF}%s\n{FFFFFF}Parola: {00C0FF}%s", name, inputtext);
- ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_MSGBOX, "{6EF83C}Vip Information", string, "-->oK<--","");
- plogin[playerid] = 1;
- }
- if (dialogid == 2)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), "vipacount/user/%s.ini", name);
- if(!response) return Kick(playerid);
- if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{6EF83C}Introdu parola pentru a te putea loga", "Login", "Leave");
- new tmp;
- tmp = dini_Int(file, "Password");
- if(udb_hash(inputtext) != tmp) {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Wrong Password", "{F81414}Parola Gresita!", "Login", "Leave");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{F81414}Vip {6EF83C}Login", "{6EF83C}Introdu parola pentru a te putea loga", "Login", "Leave");
- }
- else
- {
- plogin[playerid] = 1;
- vipinfo[playerid][viplevel] = dini_Int(file, "viplevel");
- SendClientMessage(playerid,0xFF444499, "{F81414}[VIP]: {FFFFFF}Acountul tau a fost activat foloseste {F81414}/vipcmds {FFFFFF}pe moment ai rank");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment