Author Topic: ( 3 In 1 ) Weapon Limits, Weapon System & Weapon Stats! [ By me ]  (Read 2941 times)

0 Members and 1 Guest are viewing this topic.

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Hi All I Created A New Kind In VCMP

+ Weapon System & Weapon Stats

nOte The Changelog!
!

Limits For Rocket, Minigun & Spaz

Peoples Abuses Spaz!
To Prevent It !

Peoples Can,t Use Mini
To Enable Using Them Only FOr 10 Times
Means Now You Dont Need To Delete Mini

Peoples Also Abuses ROcket
To Prevent Abusing!

i Created This System
Its Also A Gun System Too!

Here Is It!

At The Beggining
Code: [Select]
new HaveStubby[MAX_PLAYERS];
new HaveIngram[MAX_PLAYERS];
new HaveM4[MAX_PLAYERS];
new HaveM60[MAX_PLAYERS];
new HaveSniper[MAX_PLAYERS];
new HaveGrenade[MAX_PLAYERS];
new HaveDetonator[MAX_PLAYERS];
new HavePython[MAX_PLAYERS];
new HaveFlame[MAX_PLAYERS];
new HaveKatana[MAX_PLAYERS];
new HaveKnife[MAX_PLAYERS];
new HaveMini[MAX_PLAYERS];
new HaveSpaz[MAX_PLAYERS];
new HaveRocket[MAX_PLAYERS];
new MiniLimits[MAX_PLAYERS];
new RocketLimits[MAX_PLAYERS];
new SpazLimits[MAX_PLAYERS];


If You Want To Finish Spaz,ROcket,Mini Limits When Player Left The Server Add This Also
Put It On OnPlayerConnect

Code: [Select]
SpazLimits[playerid] = 0;
RocketLimits[playerid] = 0;
MiniLimits[playerid] = 0;

Put This In OnPlayerDeath!

Code: [Select]
HaveMini[playerid] = 0;
HaveSniper[playerid] = 0;
HaveRocket[playerid] = 0;
HaveM60[playerid] = 0;
HaveM4[playerid] = 0;
HaveKatana[playerid] = 0;
HavePython[playerid] = 0;
HaveStubby[playerid] = 0;
HaveSpaz[playerid] = 0;
HaveKnife[playerid] = 0;
HaveGrenade[playerid] = 0;
HavePython[playerid] = 0;
HaveFlame[playerid] = 0;

Put This In OnPlayerSpawn

Code: [Select]
new sz[124];
if (HaveMini[killerid] == 1) {
format(sz, sizeof(sz)," Mini Have A Limit : %d ", MiniLimits[killerid]);
SendClientMessage(playerid,COLOR_RED,sz);
MiniLimits[killerid]++;
}
if (HaveSpaz[killerid] == 1) {
format(sz, sizeof(sz)," Spaz Have A Limits : %d ", SpazLimits[killerid]);
SendClientMessage(playerid,COLOR_RED,sz);
SpazLimits[killerid]++;
}
if (HaveRocket[killerid] == 1) {
format(sz, sizeof(sz)," Rockets Have A Limit : %d ", RocketLimits[killerid]);
SendClientMessage(playerid,COLOR_RED,sz);
RocketLimits[killerid]++;
}
if (MiniLimits[killerid] == 10) {
SetPlayerHealth(killerid, 0);
SendClientMessage(killerid,COLOR_RED," Your Limits Are Over ");
}
if (SpazLimits[killerid] == 10) {
SetPlayerHealth(killerid, 0);
SendClientMessage(killerid,COLOR_RED," Your Limits Are Over ");
}
if (RocketLimits[killerid] == 10) {
SetPlayerHealth(killerid, 0);
SendClientMessage(killerid,COLOR_RED," Your Limits Are Over ");
}

Now CMD

put this in onplayertext
Code: [Select]
else if ( strcmp( cmd, "!wep", true ) == 0 ) {
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !wep spaz / m60 / stubby / ingram / Rocket / Flame / Sniper / M4 / Grenade / Python / Detoantor / Katana / Knife" );
else
  {
if ( strcmp( tmp, "Spaz", true ) == 0 ) {
 if (SpazLimits[playerid] == 10) {
SendClientMessage(playerid,COLOR_RED, " Your Spaz Limits Are Over ");
}
else {
HaveSpaz[playerid] = 1;
SetPlayerWeapon(playerid, 20, 99999);
}
}
 else if ( strcmp( tmp, "Rocket", true ) == 0 ) {
 if (RocketLimits[playerid] == 10) {
SendClientMessage(playerid,COLOR_RED, " Your Rocket Limits Are Over ");
}
else {
 HaveRocket[playerid] = 1;
SetPlayerWeapon(playerid, 30, 99999);
  }
  }
 else if ( strcmp( tmp, "Mini", true ) == 0 ) {
 if (MiniLimits[playerid] == 10) {
  SendClientMessage(playerid,COLOR_RED, " Your Mini Limits Are Over ");
  }
  else {
 HaveMini[playerid] = 1;
SetPlayerWeapon(playerid, 33, 99999);
}
}
else if( strcmp( tmp , "m60", true ) == 0 ) {
SetPlayerWeapon(playerid, 32, 99999);
HaveM60[playerid] = 1;
}
else if( strcmp( tmp , "flame", true ) == 0 ) {
SetPlayerWeapon(playerid, 31, 99999);
HaveFlame[playerid] = 1;
}
else if( strcmp( tmp , "sniper", true ) == 0 ) {
SetPlayerWeapon(playerid, 38, 99999);
HaveSniper[playerid] = 1;
}
else if( strcmp( tmp , "m4", true ) == 0 ) {
SetPlayerWeapon(playerid, 27, 99999);
HaveM4[playerid]=1;
}
else if( strcmp( tmp , "ingram", true ) == 0 ) {
SetPlayerWeapon(playerid, 24, 99999);
HaveIngram[playerid]=1;
}
else if( strcmp( tmp , "Stubby", true ) == 0 ) {
SetPlayerWeapon(playerid, 21, 99999);
HaveStubby[playerid]=1;
}
else if( strcmp( tmp , "bb", true ) == 0 ) {
SetPlayerWeapon(playerid, 21, 99999);
HaveStubby[playerid]=1;
}
else if( strcmp( tmp , "Python", true ) == 0 ) {
SetPlayerWeapon(playerid, 18, 99999);
HavePython[playerid]=1;
}
else if( strcmp( tmp , "detonator", true ) == 0 ) {
SetPlayerWeapon(playerid, 13, 99999);
HaveDetonator[playerid]=1;
}
else if( strcmp( tmp , "grenade", true ) == 0 ) {
SetPlayerWeapon(playerid, 12, 99999);
HaveGrenade[playerid]=1;
}
else if( strcmp( tmp , "katana", true ) == 0 ) {
SetPlayerWeapon(playerid, 10, 99999);
HaveKatana[playerid]=1;
}
else if( strcmp( tmp , "knife", true ) == 0 ) {
SetPlayerWeapon(playerid, 5, 99999);
HaveKnife[playerid]=1;
}
}

return 1;
}

Now Put This In Onplayercommandtext

Code: [Select]
else if ( strcmp( cmd, "wstats", true ) == 0 )
{
new plr;
plr = FindPlayerIDFromString( tmp );
tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c wstats [playerid]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else {
new m60, m4, mini, roc, py, ing, fla, spaz, bb, deto, kni, gre, sni, kat;
format( file, sizeof( file ), USERS_FILE, gPlayers[ plr ] );
new szMsg[222];
new sz[222];
new sz2[222];
m60 = dini_Int(file,"M60"); //
m4 = dini_Int(file,"M4"); //
spaz = dini_Int(file,"Spaz"); //
bb = dini_Int(file,"Stubby"); //
mini = dini_Int(file,"Mini");
roc = dini_Int(file,"Rocket");
fla = dini_Int(file,"Flame");
kat = dini_Int(file,"Katana");
kni = dini_Int(file,"Knife"); //
deto = dini_Int(file,"Detonator"); //
gre = dini_Int(file,"Grenade");
py = dini_Int(file,"Python"); //
ing = dini_Int(file,"Ingram"); //
sni = dini_Int(file,"Sniper"); //
format( szMsg, 222, "[ %s ] Stats Spaz[ %d ] Stubby [ %d ] Detonator [ %d ] Ingrams [ %d ] Sniper [ %d ]", gPlayers[ plr ], spaz, bb, deto, ing, sni  );
SendClientMessageToAll(COLOR_GREEN, szMsg );
format( sz, 222, "Python[ %d ] M60 [ %d ] M4 [ %d ] Knife [ %d ] Katana [ %d ]", py, m60, m4, kni, kat  );
SendClientMessageToAll(COLOR_GREEN, sz );
format( sz2, 222, "Grenades[ %d ] Flames [ %d ] Rockets [ %d ] Mini [ %d ]", gre, fla, roc, mini );
SendClientMessageToAll(COLOR_GREEN, sz2 );
   }
return 1;
}

Now Publics

Code: [Select]
public IncStatsM60( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new m60; m60 = dini_Int( file, "M60" );
dini_IntSet( file, "M60", m60 +Amount);
return m60;
}
 public IncStatsSpaz( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new spaz; spaz = dini_Int( file, "Spaz" );
dini_IntSet( file, "Spaz", spaz +Amount);
return spaz;
}
 public IncStatsM4( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new m4; m4 = dini_Int( file, "M4" );
dini_IntSet( file, "M4", m4 +Amount);
return m4;
}
 public IncStatsPython( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new py; py = dini_Int( file, "Python" );
dini_IntSet( file, "Python", py +Amount);
return py;
}
 public IncStatsKatana( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new katana; katana = dini_Int( file, "Katana" );
dini_IntSet( file, "Katana", katana +Amount);
return katana;
}
 public IncStatsKnife( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new knife; knife = dini_Int( file, "Knife" );
dini_IntSet( file, "Knife", knife +Amount);
return knife;
}
 public IncStatsStubby( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new bb; bb = dini_Int( file, "Stubby" );
dini_IntSet( file, "Stubby", bb +Amount);
return bb;
}
 public IncStatsMini( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new mini; mini = dini_Int( file, "Mini" );
dini_IntSet( file, "Mini", mini +Amount);
return mini;
}
 public IncStatsRocket( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new rocket; rocket = dini_Int( file, "Rocket" );
dini_IntSet( file, "Rocket", rocket +Amount);
return rocket;
}
 public IncStatsDetonator( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new deto; deto = dini_Int( file, "Detonator" );
dini_IntSet( file, "Detonator", deto +Amount);
return deto;
}
 public IncStatsGrenade( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new gre; gre = dini_Int( file, "Grenade" );
dini_IntSet( file, "Grenade", gre +Amount);
return gre;
}
 public IncStatsFlame( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new fla; fla = dini_Int( file, "Flame" );
dini_IntSet( file, "Flame", fla +Amount);
return fla;
}
 public IncStatsSniper( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new sni; sni = dini_Int( file, "Sniper" );
dini_IntSet( file, "Sniper", sni +Amount);
return sni;
}
 public IncStatsIngram( playerid,Amount)
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new sni; sni = dini_Int( file, "Ingram" );
dini_IntSet( file, "Ingram", sni +Amount);
return sni;
}




CREDITS : All By Me!
Benefits Of This : Prevent Abuses!
You Can Pm Me If You Like It! Thanks!

Note : Saw A Bug Report Now! & Rate My Post Also!






« Last Edit: December 16, 2013, 07:34:13 pm by mrockxkingbutt »
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: ( 3 In 1 ) Weapon Limits, Weapon System & Weapon Stats! [ By me ]
« Reply #1 on: December 16, 2013, 07:36:33 pm »
Changelog!
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol