01.03.2012, 13:30
(
Последний раз редактировалось Ballu Miaa; 17.03.2013 в 09:26.
)
- 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 -
- Callback -
- How to Use Functions -
SetPlayerCash
RemovePlayerCash
GivePlayerScore
RemovePlayerScore
GetVehicleIDByName
GetWeaponIDByName
GetVehicleNameByModel
GetWeaponNameByID
GetPlayerNameEx
SetPlayerPosEx
KickAll
BanAll
FreezeAll
UnfreezeAll
Freeze
Unfreeze
GetPlayerIPEx
Explode
ExplodeAll
Kill
KillAll
ShowMessage
- Download -
- PasteBin - v1.1 (Recommended) (New Release)
- How to Use Callback -
To use the callback just add this anywhere is your script
- Thanks -
Hope you liked my script.
regards,
Ballu Miaa
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
pawn Код:
public OnPlayerEnterWater(playerid)//Is called when a player enters water.
SetPlayerCash
pawn Код:
if(!strcmp(cmdtext, "/cash", true))
{
SetPlayerCash(playerid, 10000);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/nocash", true))
{
RemovePlayerCash(playerid, 10000);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/score", true))
{
GivePlayerScore(playerid, 100);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/noscore", true))
{
RemovePlayerScore(playerid, 50);
return 1;
}
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;
}
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;
}
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;
}
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;
}
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;
}
pawn Код:
if(!strcmp(cmdtext, "/pos", true))
{
SetPlayerPosEx(playerid, 0.0, 0.0, 0.0, 0, 0, 1);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/kickall", true))
{
KickAll();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/banall", true))
{
BanAll();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/freezeall", true))
{
FreezeAll();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/unfreezeall", true))
{
UnfreezeAll();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/freeze", true))
{
Freeze(playerid);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/unfreeze", true))
{
Unfreeze(playerid);
return 1;
}
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;
}
pawn Код:
if(!strcmp(cmdtext, "/boom", true))
{
Explode(playerid);
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/bigbang", true))
{
ExplodeAll();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/kill", true))
{
Kill();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/killall", true))
{
KillAll();
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/hi", true))
{
ShowMessage(playerid, "Hello", "Hello");
return 1;
}
- 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;
}
Hope you liked my script.
regards,
Ballu Miaa