[Include] k_functions.inc
#1

k_functions.inc
This is my first include with some functions,i took the Teleport(...) function from the include "m_teleport.inc".
Ill keep updating this include,ill be addmin more functions,callbacks...etc



Functions
Код:
stock RemovePlayerWeapon(playerid, weaponid)
stock ChatLog(playerid, text[])
stock GetIp(playerid)
stock GetName(playerid)
stock LineContainsIp(string[])
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, Float:angle)
stock Heal(playerid)
stock Armour(playerid)
stock Kill(playerid)
stock GodMode(playerid, toggle)
stock Crash(playerid)
stock Drop(playerid)
stock KickAll(playerid)
stock Freeze(playerid, toggle)
stock Slap(playerid)
stock Explode(playerid)
stock Disarm(playerid)
stock RestartServer()
stock GMX()
stock LockServer(password[])
stock VehicleEngine(vehicleid, toggle)
stock VehicleDoors(vehicleid, toggle)
stock Teleport(playerid, Float:x, Float:y, Float:z, Float:FacingAngle, world, interior, showmessage, message[], style, sound, camreset, telemessage, telename[], telecommand[])
stock ClearChat(playerid, lines)
Credits
SA-MP Team for <a_samp>
Fancy for m_teleport.inc function



Bugs
N/A

Download
Reply
#2

nice one bro
Reply
#3

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
nice one bro
Thanks
Reply
#4

Код:
stock KickAll(playerid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		Kick(playerid);
	}
	return 1;
}
That is not going to do the job. Change it to something like this:

Код:
stock KickAll()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		Kick(i);
	}
	return 1;
}
Reply
#5

PHP код:
stock KickAll()
{
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        
Kick(i);
    }
    return 
1;

Reply
#6

Just a tip: a function does something and should therefore always have a verb in its name. Get, set, add, remove, toggle, ... You know what I mean.
Reply
#7

Health, Armor & Kill are quite useless as the original natives are one-liners & natives are called faster than functions.
Reply
#8

I feel like rewriting everthing in this include, just to show you all of the things you did bad...

I'm not downing you, but it could be better. A LOT better.

Two examples:
pawn Код:
#define FreezePlayer(%0, %1)\// originally stock Freeze
    TogglePlayerControllable(%0, !%1)
pawn Код:
static __T_NAME[MAX_PLAYER_NAME];
#define ReturnPlayerName(%0)\// originally stock GetName(playerid)
    (GetPlayerName(%0,__T_NAME,MAX_PLAYER_NAME),__T_NAME)
Reply
#9

Quote:
Originally Posted by JasperM
Посмотреть сообщение
Код:
stock KickAll(playerid)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		Kick(playerid);
	}
	return 1;
}
That is not going to do the job. Change it to something like this:

Код:
stock KickAll()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		Kick(i);
	}
	return 1;
}
Oh sorry i didnt noticed lol

Quote:
Originally Posted by Crayder
Посмотреть сообщение
I feel like rewriting everthing in this include, just to show you all of the things you did bad...

I'm not downing you, but it could be better. A LOT better.

Two examples:
pawn Код:
#define FreezePlayer(%0, %1)\// originally stock Freeze
    TogglePlayerControllable(%0, !%1)
pawn Код:
static __T_NAME[MAX_PLAYER_NAME];
#define ReturnPlayerName(%0)\// originally stock GetName(playerid)
    (GetPlayerName(%0,__T_NAME,MAX_PLAYER_NAME),__T_NAME)
Thanks for info

Quote:
Originally Posted by Vince
Посмотреть сообщение
Just a tip: a function does something and should therefore always have a verb in its name. Get, set, add, remove, toggle, ... You know what I mean.
And thanks to you too for this tip ^
Reply
#10

Good Job Mate .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)