Author Topic: [Snippet] VIP system  (Read 12537 times)

0 Members and 1 Guest are viewing this topic.

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
[Snippet] VIP system
« on: February 27, 2013, 01:54:42 pm »
Hey folks been busy with my exams and i still am, i got some minutes after revising ma whole paper :D so got time to browse little and here it is VIP SYSTEM. First time for 0.3z R2 so its for GUPS why? Because i see most of the new comers or still people is using it so i thought it would be better for that.

Coding Time...

Define this on top:

Code: [Select]
#define VIP_FILE          "/Vips/%s.ini"
Add this on the top:

Code: [Select]
enum playerInfo
{
Spawnedp,
  brb,
  back,
  muted,
  Password[MAX_PASS_SIZE+1],
Logged,
FalseLogins,
prank,
Level,
VLevel
}


enum vipinfo
{
IsVip
}

enum commandcount
{
healthc,
armourc
}

I am using many enums to to make less confusion... if you are skilled enough you can use these all in 1 enum...

You already have the pinfo defined so just add this under that

Code: [Select]
new vinfo[MAX_PLAYERS][vipinfo];
Very Important and Careful step

Go on the Register command and add these lines with the other Dini_ Lines.

Code: [Select]
dini_Create(file3);
dini_Set( file3, "VIP", "0" );

Go to your /c login command and search for the
Code: [Select]
if(strcmp(getpass(tmp), pass_confirm, true) == 0)
{

Add this on the top section of that.

Code: [Select]
vlevel = dini_Int( file3, "VIP" );
    pInfo[ playerid ][ VLevel ] = vlevel;

Add this under THIS
Code: [Select]
if(strcmp(getpass(tmp), pass_confirm, true) == 0)
{

REMBER TO ADD THIS UNDER THAT LINE AND THE OTHER UP ON THAT LINE ( im saying again and again because you will end up owned if you do something wrong because this is TOTALLY tested and works fine so if you guys get errors then its not scripts fault )

Code: [Select]
if(dini_Exists(file3)) return SendclientMessage(playerid, RED, "[Server] VIP Account Loaded");
{
vlevel = GetVL(gPlayers[ playerid ] );
pInfo[playerid][VLevel] = vlevel;
vinfo[playerid][IsVip] = 1;
format(szMsg,128,"[VIP] %s Is Now Logged-In and Connected",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
format( szMsg, sizeof( szMsg ), "VIP Level %d ( %s )",vlevel, Vlevels( vlevel ) );
SendClientMessage(playerid,RED,szMsg);
}


Add these commands carefully

Code: [Select]
//=========================================[ VIP FUNCTIONS ]=============================================================

else if ( strcmp( cmd, "vgoto", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREY, "[Server Error] /c vgoto [Nick/ID]" );
else if( pInfo[playerid][VLevel] < 2 ) return SendClientMessage(playerid,GREEN,"[Server Protection] You Are Not VIP");
else
{
    new plr = FindPlayerIDFromString( tmp );
    if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_GREEN, "[Server Error] Unknown player" );
    else
{
    GetPlayerPos( plr, x, y, z );
SetPlayerPos( playerid, x, y + 1.0, z, 0, 0 );
format( szMsg, sizeof( szMsg ), "[VIP COMMAND] Teleportation [ [VIP] %s ] to:[ %s ]", gPlayers[ playerid ], gPlayers[ plr ] );
SendClientMessageToAll( COLOR_GREEN, szMsg );
}
}
return 1;

}
else if ( strcmp( cmd, "vsay", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREY, "[Server Error] /c vsay [Text]" );
else if( pInfo[playerid][VLevel] < 3 ) return SendClientMessage(playerid,GREEN,"[Server Protection] You Are Not VIP");
else
{
    GetPlayerTeam(playerid);
    if(GetPlayerTeam(playerid) == 1)
    {
format( szMsg, sizeof( szMsg ), "[VIP] %s: %s ", gPlayers[ playerid ], cmdtext[4] );
SendClientMessageToAll( ORANGE, szMsg );
}

            else if(GetPlayerTeam(playerid) == 2)
    {
format( szMsg, sizeof( szMsg ), "[VIP] %s: %s ", gPlayers[ playerid ], cmdtext[4] );
SendClientMessageToAll( PURPLEE, szMsg );
}
}
return 1;

        }
else if (strcmp(cmd, "donate", true) == 0 )
{
  SendClientMessage(playerid,BLUE,"=================>[V.I.P]<=============== ");
    SendClientMessage(playerid,BLUE,"Lvl 1 [Bronze], Lvl2 [Silver], Lvl3 [GOLD], Lvl4 [PREMIUM]");
    SendClientMessage(playerid,BLUE,"Check /c vip for level informations");
    return 1;

}
else if (strcmp(cmd, "buy", true) == 0 || strcmp(cmd,"shop", true) == 0)
{
  SendClientMessage(playerid,BLUE,"=================>[V.I.P]<=============== ");
    SendClientMessage(playerid,BLUE,"/c vwep [ any weapon ]");
    SendClientMessage(playerid,BLUE,"Heavy Weapons, Money on spawn including to level");
    return 1;

}
else if (strcmp(cmd, "vip", true) == 0)
{
  SendClientMessage(playerid,BLUE,"[/c] level1 Upto level4. Use number for the current level cmds" );
    return 1;
   
    }
else if (strcmp(cmd, "level1", true) == 0)
{
  SendClientMessage(playerid,BLUE,"[/c] vwep + 200$ on each spawn" );
    return 1;
   
    }
else if (strcmp(cmd, "level2", true) == 0)
{
  SendClientMessage(playerid,BLUE,"[/c] vwep, vgoto+ 500$ on each spawn" );
    return 1;
   
    }
else if (strcmp(cmd, "level3", true) == 0)
{
  SendClientMessage(playerid,BLUE,"[/c] vwep, vgoto, vsay, armour + 1500$ on each spawn" );
    return 1;
   
    }
else if (strcmp(cmd, "level4", true) == 0)
{
  SendClientMessage(playerid,BLUE,"[/c] vwep, vgoto, vsay, health, armour + 10000$ on each spawn" );
    return 1;
   
}
else if (strcmp(cmd, "vwep", true) == 0)
{
if(pInfo[playerid][VLevel] == 0)
{
SendClientMessage(playerid,RED,"[Server Protection] You Are not VIP " );
}
else
{
tmp = strtok( cmdtext, idx );
new wep[256];
wep[1] = FindWepIDFromString ( tmp );
GivePlayerWeapon(playerid,wep[1], 9999);
}
}

else if (strcmp(cmd, "health", true) == 0)
{
if(pInfo[playerid][VLevel] == 0)
{
SendClientMessage(playerid,RED,"[Server Protection] You Are not VIP " );
}
else if(pInfo[playerid][VLevel] < 3)
{
    SendClientMessage(playerid,RED,"[Server Protection] You Are not high enough VIP level" );
}
else
{
  new Float:health;
if(cmdinfo[playerid][healthc] == 0)
    {
  cmdinfo[playerid][healthc] = 1;
  GetPlayerHealth(playerid,health);
  SetPlayerHealth(playerid,health+25);
  format(szMsg,256,"V.I.P %s used vip cmd to get +50 health",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
  return 0;
  }
  else if(cmdinfo[playerid][healthc] == 1)
  {
  cmdinfo[playerid][healthc] = 2;
  GetPlayerHealth(playerid,health);
  SetPlayerHealth(playerid,health+25);
  format(szMsg,256,"V.I.P %s used vip cmd to get +50 health",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
  return 0;
  }
  else if(cmdinfo[playerid][healthc] == 2)
{
  cmdinfo[playerid][healthc] = 3;
  GetPlayerHealth(playerid,health);
  SetPlayerHealth(playerid,health+25);
  format(szMsg,256,"V.I.P %s used vip cmd to get +50 health",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
  return 0;
  }
  else if(cmdinfo[playerid][healthc] == 3)
  {
  SendClientMessage(playerid,BLUE,"[Server] VIP cmd Limit Exceeded! [ Max 3 At Each Spawn ]");
  }
  }
    return 1;

}

else if (strcmp(cmd, "armour", true) == 0)
{
if(pInfo[playerid][VLevel] == 0)
{
SendClientMessage(playerid,RED,"[Server Protection] You Are not VIP " );
}
else if(pInfo[playerid][VLevel] < 3)
{
    SendClientMessage(playerid,RED,"[Server Protection] You Are not high enough VIP level" );
}
else
{
  new Float:armour;
if(cmdinfo[playerid][armourc] == 0)
    {
  cmdinfo[playerid][armourc] = 1;
  GetPlayerArmour(playerid,armour);
  SetPlayerArmour(playerid,armour+25);
  format(szMsg,256,"V.I.P %s used vip cmd to get +25 armour",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
  return 0;
  }
  else if(cmdinfo[playerid][armourc] == 1)
  {
  cmdinfo[playerid][armourc] = 2;
  GetPlayerArmour(playerid,armour);
  SetPlayerArmour(playerid,armour+25);
  format(szMsg,256,"V.I.P %s used vip cmd to get +25 armour",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
  return 0;
  }
  else if(cmdinfo[playerid][armourc] == 2)
{
  cmdinfo[playerid][armourc] = 3;
  GetPlayerArmour(playerid,armour);
  SetPlayerArmour(playerid,armour+25);
        format(szMsg,256,"V.I.P %s used vip cmd to get +25 armour",gPlayers[playerid]);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
  return 0;
  }
  else if(cmdinfo[playerid][armourc] == 3)
  {
  SendClientMessage(playerid,BLUE,"[Server] VIP cmd Limit Exceeded! [ Max 3 At Each Spawn ]");
  }
  }
    return 1;
}
//===========================================[ VIP FUNCTIONS END ] ==========================================

Add this at OnPlayerSpawn

Code: [Select]
if(pInfo[playerid][VLevel] == 1)
{
new cash;
cash = GetPlayerMoney(playerid);
SetPlayerMoney(playerid,cash+200);
}

if(pInfo[playerid][VLevel] == 2)
{
new cash;
cash = GetPlayerMoney(playerid);
SetPlayerMoney(playerid,cash+500);
}

if(pInfo[playerid][VLevel] == 3)
{
new cash;
cash = GetPlayerMoney(playerid);
SetPlayerMoney(playerid,cash+1500);
}

if(pInfo[playerid][VLevel] == 4)
{
new cash;
cash = GetPlayerMoney(playerid);
SetPlayerMoney(playerid,cash+10000);
}

Add these 2 functions at top of STOCKS

Code: [Select]
public GetVL(player[])
{
new vl;
format( file3, sizeof( file3 ), VIP_FILE, player);
vl = dini_Int( file3, "VIP" );
return vl;
}

public Vlevels(vlevel)
{
new vl[ 30 ];
if (vlevel == 1 ) vl = "Bronze";
else if (vlevel == 2) vl = "Silver";
else if (vlevel == 3) vl = "Gold";
else if (vlevel == 4) vl = "PREMIUM";
return vl;
}

Finally Go to Scriptfiles > Create a new folder and name it Vips BE CAREFUL WITH CAPITAL AND SMALL LETTERS TYPE IT THE WAY IT IS

After registration you will get a file in Vips folder with players name and you can set him whatever level you want so 0 = normal, 1 = Bronze, 2 = Silver, 3 = Gold and 4 = Premium.

To Set already registered player to VIP use this command:

Code: [Select]
else if ( strcmp( cmd, "Setvip", true ) == 0 )
{
new plr, tmp2[256];
tmp = strtok( cmdtext, idx ), tmp2 = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
        if( !IsPlayerAdmin(playerid) ) return 0;
else if ( !strlen(tmp2) ) SendClientMessage( playerid, COLOR_RED, "[Server] /c makevip [Nick/ID] [Level]");
  else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else
{
format( szMsg, sizeof( szMsg ), "[Admin] %s Has Promoted Player %s To VIP", gPlayers[ playerid ], gPlayers[ plr ]);
SendClientMessageToAll( COLOR_GREEN, szMsg );
format(file3, sizeof(file3), VIP_FILE, PlayerName(plr));
dini_Create(file3);
dini_Set( file3, "VIP", tmp2 );
}
return 1;

}

If you encounter problems i won't be able to help you ( Maybe ) because of exams and if you add it totally right it will definitely work.. Have fun

Credits would be appreciated
« Last Edit: February 28, 2013, 07:34:31 pm by Doom »

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: [Snippet] VIP system
« Reply #1 on: February 28, 2013, 03:20:06 am »
LOL
You COPIED THESE FROM CUBAN VS HAITEN LOL
DOOM MAKE YOUR OWN SYSTEMS DONT COPY
LOLOLOLOLOLOLOLOL
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: [Snippet] VIP system
« Reply #2 on: February 28, 2013, 08:04:24 am »
nice doom this good you think you can do this for SQ

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Re: [Snippet] VIP system
« Reply #3 on: February 28, 2013, 02:23:17 pm »
@mrockxkingbutt

And do you have any idea which was that taken from? that script is used by Hero Which I Gave him and 1 more thing some... i won't insult because its against forum rules but those noobs are shitting around with me... i gave this to Hero when i didn't even join VCMP forum lol, how i give him? i played with him at SA-MP at a zombie server and if you still have shit he is banned from here and im not so  :-\  ;)


nice doom this good you think you can do this for SQ

Sure, when i have time [ ma exams XD ] i will make it.

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: [Snippet] VIP system
« Reply #4 on: February 28, 2013, 07:05:38 pm »
Is stupid because is the same promoved the player level admin
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Snippet] VIP system
« Reply #5 on: February 28, 2013, 07:43:46 pm »
Is stupid because is the same promoved the player level admin

hALEDark, you are stupid. You...are...stu-pid. You.


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline Fire_Head

  • Street Thug
  • *
  • Posts: 35
    • View Profile
Re: [Snippet] VIP system
« Reply #6 on: February 28, 2013, 08:10:25 pm »
 you all are stupid  >:(

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Snippet] VIP system
« Reply #7 on: February 28, 2013, 09:00:17 pm »
you all are stupid  >:(

Including you, sir  :D


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: [Snippet] VIP system
« Reply #8 on: February 28, 2013, 10:49:24 pm »
No-One Is Stupid Here
Stop Insulting Each Other
It Against The Rules
:P
LOLGUYS
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Snippet] VIP system
« Reply #9 on: February 28, 2013, 10:56:02 pm »
No-One Is Stupid Here
Stop Insulting Each Other
It Against The Rules
:P
LOLGUYS

Stol LAWLing


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Re: [Snippet] VIP system
« Reply #10 on: March 01, 2013, 01:17:06 pm »
Stop trolling around i don't care if your stupid or not if he didn't like it then what? just leave it, its what he thinks and let him tell so and tell me if you guys like it or not just post that any other things then you have Discussion board...  :D ;)

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: [Snippet] VIP system
« Reply #11 on: March 01, 2013, 08:44:37 pm »
Let's start a new topic named "DUMBASSES" and troll people in it? This'd be the greatest resolution vaar Haledark who hates me a lot and other haterz. I wish you only good :D


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: [Snippet] VIP system
« Reply #12 on: March 02, 2013, 12:38:07 am »
If you guys can't act in a mature manner, I'd be glad to hand out tempbans from this forum.
Do not PM me for support.




Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Re: [Snippet] VIP system
« Reply #13 on: March 02, 2013, 07:44:11 am »
If you guys can't act in a mature manner, I'd be glad to hand out tempbans from this forum.

 ::) Finally someone made his mind to take a look here...

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: [Snippet] VIP system
« Reply #14 on: March 02, 2013, 09:00:02 pm »
FUCK  YOU

User was unbanned for this topic.
« Last Edit: March 05, 2013, 12:19:28 am by aledark24 »
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint