[Include] bLibrary(22 functions and 1 custom callback)
#1

- Introduction -
I decided to release this small library i made within 15-20 minutes.I hope you like this.It has 22 custom functions as well as 1 custom callback.I know its pretty simple to make for intermediate and advanced scripter's. But beginner's still have lot of problem's with creating all these function's. So Just made a library for it. So that they can use this library for their game mode.

- Natives -
pawn Код:
native SetPlayerCash(playerid, cash);
//Description - Sets the player's cash
native RemovePlayerCash(playerid, cash);
//Description - Removes the player's cash.Don't type -cash i.e RemovePlayerCash(playerid, -1000) just write RemovePlayerCash(playerid, 1000);
native GivePlayerScore(playerid, score);
//Description - Gives Player Score
native RemovePlayerScore(playerid, score);
//Description - Removes the player's score.Don't type -score i.e RemovePlayerScore(playerid, -1000) just write RemovePlayerScore(playerid, 1000);
native GetVehicleIDByName(name[]);
//Description - Gets the ID of the vehicle by it's name
native GetWeaponIDByName(name[]);
//Description - Gets the ID of the weapon by it's name
native GetVehicleNameByModel(model);
//Description - Gets the name of the vehicle by it's ID
native GetWeaponNameByID(id);
//Description - Gets the name of the weapon by it's ID
native GetPlayerNameEx(playerid);
//Description - A much better way to Get the player's name
native SetPlayerPosEx(playerid, Float:x ,Float:y,Float:z,Angle,interior,VirtualWorld);
//Description - Sets the players position.Interior and Virtual World are optional parameters.
native KickAll();
//Description - Self Explanatory
native BanAll();
//Description - Self Explanatory
native FreezeAll();
//Description - Self Explanatory
native UnfreezeAll();
//Description - Self Explanatory
native Freeze(playerid);
//Description - Self Explanatory
native Unfreeze(playerid);
//Description - Self Explanatory
native GetPlayerIPEx(playerid);
//Description - Gets a player's IP
native Explode(playerid);
//Description - Self Explanatory
native ExplodeAll();
//Description - Self Explanatory
native Kill(playerid);
//Description -  Self Explanatory
native KillAll();
//Description - Self Explanatory
native ShowMessage(playerid, caption[], info[]);
//Description - Shows a Message Box
- Callback -
pawn Код:
public OnPlayerEnterWater(playerid)//Is called when a player enters water.
- How to Use Functions -
SetPlayerCash
pawn Код:
if(!strcmp(cmdtext, "/cash", true))
    {
        SetPlayerCash(playerid, 10000);
        return 1;
       
    }
RemovePlayerCash
pawn Код:
if(!strcmp(cmdtext, "/nocash", true))
    {
        RemovePlayerCash(playerid, 10000);
        return 1;
       
    }
GivePlayerScore
pawn Код:
if(!strcmp(cmdtext, "/score", true))
    {
        GivePlayerScore(playerid, 100);
        return 1;
       
    }
RemovePlayerScore
pawn Код:
if(!strcmp(cmdtext, "/noscore", true))
    {
        RemovePlayerScore(playerid, 50);
        return 1;
       
    }
GetVehicleIDByName
pawn Код:
if(!strcmp(cmdtext, "/car", true))    
   {
    new vehicle = GetVehicleIdByName(params); //converts the vehiclename to modelID
    if(vehicle == -1) return SendClientMessage(playerid,-1,"Invalid vehicle name!");
    new Float:pos[3];GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
    CreateVehicle(vehicle,pos[0],pos[1],pos[2]);
    return 1;
}
GetWeaponIDByName
pawn Код:
if(!strcmp(cmdtext, "/weapon", true))
    {
            new weapon = GetWeaponIdByName(params); //converts the weaponname to weaponmodel
            if(weapon == -1) return SendClientMessage(playerid,-1,"Invalid weapon name!");
            GivePlayerWeapon(playerid,weapon,100);
        return 1;
       
    }
GetVehicleNameByModel
pawn Код:
if(!strcmp(cmdtext, "/vehiclename", true))
    {
        new vehicle = GetVehicleNameByModel(432);
        new string[125];
        format(string, sizeof(string), "You are currently sitting in a %s", vehicle);
        SendClientMessage(playerid, -1, string);
        return 1;
       
    }
GetWeaponNameByID
pawn Код:
if(!strcmp(cmdtext, "/weaponname", true))
    {
        new weapon = GetWeaponNameByID(2);
        new string[125];
        format(string, sizeof(string), "You currently have a %s in hand", weapon);
        SendClientMessage(playerid, -1, string);
        return 1;
       
    }
GetPlayerNameEx
pawn Код:
if(!strcmp(cmdtext, "/name", true))
    {
        new string[125];
        format(string, sizeof(string), "Your name is %s", GetPlayerNameEx(playerid));
        SendClientMessage(playerid, -1, string);
        return 1;
       
    }
SetPlayerPosEx
pawn Код:
if(!strcmp(cmdtext, "/pos", true))
    {
        SetPlayerPosEx(playerid, 0.0, 0.0, 0.0, 0, 0, 1);
        return 1;
       
    }
KickAll
pawn Код:
if(!strcmp(cmdtext, "/kickall", true))
    {
        KickAll();
        return 1;
       
    }
BanAll
pawn Код:
if(!strcmp(cmdtext, "/banall", true))
    {
        BanAll();
        return 1;
       
    }
FreezeAll
pawn Код:
if(!strcmp(cmdtext, "/freezeall", true))
    {
        FreezeAll();
        return 1;
       
    }
UnfreezeAll
pawn Код:
if(!strcmp(cmdtext, "/unfreezeall", true))
    {
        UnfreezeAll();
        return 1;
       
    }
Freeze
pawn Код:
if(!strcmp(cmdtext, "/freeze", true))
    {
        Freeze(playerid);
        return 1;
       
    }
Unfreeze
pawn Код:
if(!strcmp(cmdtext, "/unfreeze", true))
    {
        Unfreeze(playerid);
        return 1;
       
    }
GetPlayerIPEx
pawn Код:
if(!strcmp(cmdtext, "/myip", true))
    {
        new ip = GetPlayerIPEx(playerid);
        new string[125];
        format(string, sizeof(string), "Your ip is %d", ip);
        SendClientMessage(playeridm -1, string);
        return 1;
       
    }
Explode
pawn Код:
if(!strcmp(cmdtext, "/boom", true))
    {
        Explode(playerid);
        return 1;
       
    }
ExplodeAll
pawn Код:
if(!strcmp(cmdtext, "/bigbang", true))
    {
        ExplodeAll();
        return 1;
       
    }
Kill
pawn Код:
if(!strcmp(cmdtext, "/kill", true))
    {
        Kill();
        return 1;
       
    }
KillAll
pawn Код:
if(!strcmp(cmdtext, "/killall", true))
    {
        KillAll();
        return 1;
       
    }
ShowMessage
pawn Код:
if(!strcmp(cmdtext, "/hi", true))
    {
        ShowMessage(playerid, "Hello", "Hello");
        return 1;
       
    }
- Download -
- PasteBin - v1.1 (Recommended) (New Release)
- How to Use Callback -
To use the callback just add this anywhere is your script
pawn Код:
public OnPlayerEnterWater(playerid)
{
    //Your Code Here
    return 1;
}
- Thanks -
Hope you liked my script.
regards,

Ballu Miaa
Reply


Messages In This Thread
bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 01.03.2012, 13:30
Re: bLibrary(22 functions and 1 custom callback) - by Littlehelper - 01.03.2012, 14:11
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 01.03.2012, 14:18
Re: bLibrary(22 functions and 1 custom callback) - by wups - 01.03.2012, 14:38
Re: bLibrary(22 functions and 1 custom callback) - by Psymetrix - 01.03.2012, 14:43
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 01.03.2012, 15:05
Re: bLibrary(22 functions and 1 custom callback) - by Aldo. - 01.03.2012, 15:09
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 01.03.2012, 15:19
Re: bLibrary(22 functions and 1 custom callback) - by Psymetrix - 01.03.2012, 15:30
Re: bLibrary(22 functions and 1 custom callback) - by iTorran - 01.03.2012, 15:32
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 01.03.2012, 15:38
Re: bLibrary(22 functions and 1 custom callback) - by Psymetrix - 01.03.2012, 15:38
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 01.03.2012, 15:45
Re: bLibrary(22 functions and 1 custom callback) - by xkirill - 01.03.2012, 19:17
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 02.03.2012, 13:21
Re: bLibrary(22 functions and 1 custom callback) - by iTorran - 02.03.2012, 15:12
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 02.03.2012, 16:14
Re: bLibrary(22 functions and 1 custom callback) - by [HK]Ryder[AN] - 03.03.2012, 15:30
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 04.03.2012, 05:23
Re: bLibrary(22 functions and 1 custom callback) - by Niko_boy - 06.03.2012, 08:25
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 06.03.2012, 13:06
Re: bLibrary(22 functions and 1 custom callback) - by VincentDunn - 09.03.2012, 04:04
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 09.03.2012, 04:07
Re: bLibrary(22 functions and 1 custom callback) - by Mr.Fames - 26.04.2012, 16:46
Re: bLibrary(22 functions and 1 custom callback) - by Jonny5 - 26.04.2012, 17:21
Re: bLibrary(22 functions and 1 custom callback) - by Marko Koprivanac - 26.04.2012, 17:46
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 27.04.2012, 03:20
Re: bLibrary(22 functions and 1 custom callback) - by ninjahippie - 27.04.2012, 07:55
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 27.04.2012, 08:03
Re: bLibrary(22 functions and 1 custom callback) - by FalconX - 01.05.2012, 19:28
Re: bLibrary(22 functions and 1 custom callback) - by king_hual - 01.05.2012, 22:50
Re: bLibrary(22 functions and 1 custom callback) - by Ballu Miaa - 02.05.2012, 02:07

Forum Jump:


Users browsing this thread: 12 Guest(s)