[Include] [INC]Functions
#1

What is it
This include has fallowing functions:


Код:
IsPlayerAntiBikeFallToggled(playerid) // Will return 0 if it is not toggled, 1 if it is
IsPlayerMuted(playerid) // Will return 0 if it is not toggled, 1 if it is
IsPlayerJailed(playerid) // Will return 0 if it is not toggled, 1 if it is
IsVehicleGodModeToggled(playerid) // Will return 0 if it is not toggled, 1 if it is
IsPlayerGodModeToggled(playerid) // Will return 0 if it is not toggled, 1 if it is
TogglePlayerMuted(playerid, toggle) // Will (un)mute the given playerid
TogglePlayerJailed(playerid, toggle) // Will (un)jail the given playerid
TogglePlayerGodMode(playerid, toggle) // Will enable/disable godmdoe for the given playerid
TogglePlayerAntiBikeFall(playerid, toggle) Will enable/disable antibikefall for the given playerid >>> NOTE: NOT TESTED! IF ANYONE HAS TIME PLEASE TELL ME IF IT WORKS!
GetPlayerNameEx(playerid) // Will return the player name from the given playerid
GetPlayerIpEx(playerid) // Will return the player ip from the given playerid
GetPlayerHealthEx(playerid) // Will return the player health from the given playerid
GetPlayerArmourEx(playerid)// Will return the player armour from the given playerid
 GetPlayerPosEx(playerid)// Will return the players position from the given playerid (NOTE: It will return as a string! Examples given.)
Example for the usage:
Код:
// Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/stats", cmdtext, true) == 0)
	{
	    new string[200];
	    format(string, sizeof(string), "Welcome %s", GetPlayerNameEx(playerid));
	    SendClientMessage(playerid, 0xFFFFFFFF, string); print(string);
	    format(string, sizeof(string), "Your name is %s , your ip is %s and your position is: %s", GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), GetPlayerPosEx(playerid));
	    SendClientMessage(playerid, 0xFFFFFFFF, string); print(string);
	    format(string, sizeof(string), "Your Armour: %d.0, Health: %d.0", GetPlayerArmourEx(playerid), GetPlayerHealthEx(playerid));
	    SendClientMessage(playerid, 0xFFFFFFFF, string); print(string);
	    format(string, sizeof(string), "Godmode: %d | Vehicle godmode: %d | Muted: %d | Jailed: %d", IsPlayerGodModeToggled(playerid), IsVehicleGodModeToggled(playerid), IsPlayerMuted(playerid), IsPlayerJailed(playerid)); print(string);
	    return 1;
	}
	return 1;
}

// Will output:
Welcome [TFD]Steve
Your name is [TFD]Steve , your ip is 127.0.0.1 and your position is: 2327.163574,1395.270507,42.820312
Your Armour: 0.0, Health: 100.0
Godmode: 0 | Vehicle godmode: 0 | Muted: 0 | Jailed: 0
Alot easier!


Download links:
Pastebin
Solidfiles
2Shared
Installation:

1) Download the files from a link
2) Put the file to SERVERDIRECTORY/pawno/include
3) Put "#include <Function>" without quotes after "#include <a_samp>" in your gamemode
4) Done (Check for errors, if there are any I will try to help)!
Note:

Anti Bike Fall is untested! Tell me if it works. I'm on my dad's pc which do not have GTA SA.
Reply


Messages In This Thread
[INC]Functions - by Steve* - 01.05.2011, 14:42
Re: [INC]Functions - by Kwarde - 01.05.2011, 14:49
Re: [INC]Functions - by Steve* - 01.05.2011, 14:51
Re: [INC]Functions - by Steve* - 01.05.2011, 14:55
Re: [INC]Functions - by justsomeguy - 01.05.2011, 16:07
Re: [INC]Functions - by Zh3r0 - 01.05.2011, 16:15
Re: [INC]Functions - by Kwarde - 01.05.2011, 16:29

Forum Jump:


Users browsing this thread: 2 Guest(s)