Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: Doom 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:
#define VIP_FILE "/Vips/%s.ini"
Add this on the top:
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
new vinfo[MAX_PLAYERS][vipinfo];
Very Important and Careful step
Go on the Register command and add these lines with the other Dini_ Lines.
dini_Create(file3);
dini_Set( file3, "VIP", "0" );
Go to your /c login command and search for the if(strcmp(getpass(tmp), pass_confirm, true) == 0)
{
Add this on the top section of that.
vlevel = dini_Int( file3, "VIP" );
pInfo[ playerid ][ VLevel ] = vlevel;
Add this under THISif(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 )
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
//=========================================[ 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
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
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:
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
-
LOL
You COPIED THESE FROM CUBAN VS HAITEN LOL
DOOM MAKE YOUR OWN SYSTEMS DONT COPY
LOLOLOLOLOLOLOLOL
-
nice doom this good you think you can do this for SQ
-
@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.
-
Is stupid because is the same promoved the player level admin
-
Is stupid because is the same promoved the player level admin
hALEDark, you are stupid. You...are...stu-pid. You.
-
you all are stupid >:(
-
you all are stupid >:(
Including you, sir :D
-
No-One Is Stupid Here
Stop Insulting Each Other
It Against The Rules
:P
LOLGUYS
-
No-One Is Stupid Here
Stop Insulting Each Other
It Against The Rules
:P
LOLGUYS
Stol LAWLing
-
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 ;)
-
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
-
If you guys can't act in a mature manner, I'd be glad to hand out tempbans from this forum.
-
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...
-
FUCK YOU
User was unbanned for this topic.
-
yes he copied the TDM vip system and this not work in other scripts aledark is right make your own script then post here if you copy someone script and post here then u can post up then 1000 scripts so don't copy :d and stop insulting bigger rank member!
-
@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 :-\ ;)