//playerfuncs.inc native GivePlayerScore(playerid, score); native SetPlayerMoney(playerid, money); native RemovePlayerWeapoon(playerid, weaponid); native SetPlayerFacingPoint(playerid, Float:x, Float:y); native IsPlayerFacingPoint(playerid, Float:x, Float:y, Float:range = 10.0); native SetPlayerFacingPlayer(playerid, targetid); native IsPlayerFacingPlayer(playerid, targetid, Float:range = 10.0); native IsPlayerBehindPlayer(playerid, targetid, Float:range = 10.0); native GetPlayerWeaponAmmo(playerid, weaponid); native SetPlayerWeaponAmmo(playerid, weaponid, ammo); native SetPlayerWalkingStyle(playerid, style); native GetPlayerWalkingStyle(playerid); native GetPlayerSkillLevel(playerid, skill); //playercalls.inc native IsPlayerPaused(playerid); native GetPlayerPausedTime(playerid); //playerstates.inc native IsPlayerSpawned(playerid); native IsPlayerSpectating(playerid); native IsPlayerDriver(playerid); native IsPlayerInClassSelection(playerid); native IsPlayerDead(playerid); //playerstats.inc native GetPlayerKills(playerid); native GetPlayerDeaths(playerid); native GetPlayerSpree(playerid); native GetPlayerConnectedTime(playerid, &hours, &minutes, &seconds); native GetPlayerHeadshots(playerid); native GetPlayerWeaponShots(playerid); native GetPlayerWeaponHits(playerid); |
//playerfuncs.inc public public OnPlayerWalk(playerid, style) //playercalls.inc public OnPlayerPosChange(playerid, Float:newx, Float:newy, Float:newz, Float:oldx, Float:oldy, Float:oldz); public OnPlayerFacingAngleChange(playerid, Float:newangle, Float:oldangle); public OnPlayerWeaponChange(playerid, newweapon, oldweapon); public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth); public OnPlayerArmourChange(playerid, Float:newarmour, Float:oldarmour); public OnPlayerVirtualWorldChange(playerid, newworld, oldworld); public OnPlayerSkinChange(playerid, newskin, oldskin); public OnPlayerPingChange(playerid, newping, oldping); public OnPlayerAmmoChange(playerid, weaponid, newammo, oldammo); public OnPlayerKillPlayer(playerid, killerid, weaponid); public OnPlayerPause(playerid); public OnPlayerUnpause(playerid, time); public OnPlayerFakeKill(playerid, count); public OnPlayerMoneyChange(playerid, newmoney, oldmoney); public OnPlayerScoreChange(playerid, newscore, oldscore); //playerstates.inc //no callbacks //playerstats.inc public OnPlayerHeadshot(playerid, issuerid, weaponid) |
public OnPlayerSpawn(playerid)
{
SetplayerWalkingStyle(playerid, WALKING_STYLE_DRUNK);
return 1;
}
//walking styles
#define WALKING_STYLE_DEFAULT 0
#define WALKING_STYLE_CIVILIAN 1
#define WALKING_STYLE_GANGSTA 2
#define WALKING_STYLE_GANGSTA_2 3
#define WALKING_STYLE_OLD 4
#define WALKING_STYLE_FAT_OLD 5
#define WALKING_STYLE_FAT 6
#define WALKING_STYLE_LADY 7
#define WALKING_STYLE_LADY_2 8
#define WALKING_STYLE_WHORE 9
#define WALKING_STYLE_WHORE_2 10
#define WALKING_STYLE_DRUNK 11
#define WALKING_STYLE_BLIND 12
#define WALKING_STYLE_ARMED 13
public OnPlayerPosChange(playerid, Float:newx, Float:newy, Float:newz, Float:oldx, Float:oldy, Float:oldz)
{
return 1;
}
public OnPlayerFacingAngleChange(playerid, Float:newangle, Float:oldangle)
{
return 1;
}
public OnPlayerWeaponChange(playerid, newweapon, oldweapon)
{
return 1;
}
public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
return 1;
}
public OnPlayerArmourChange(playerid, Float:newarmour, Float:oldarmour)
{
return 1;
}
public OnPlayerVirtualWorldChange(playerid, newworld, oldworld)
{
return 1;
}
public OnPlayerSkinChange(playerid, newskin, oldskin)
{
return 1;
}
public OnPlayerPingChange(playerid, newping, oldping)
{
return 1;
}
public OnPlayerAmmoChange(playerid, weaponid, newammo, oldammo)
{
return 1;
}
public OnPlayerKillPlayer(playerid, killerid, weaponid)
{
return 1;
}
public OnPlayerPause(playerid)
{
return 1;
}
public OnPlayerUnpause(playerid, time)
{
return 1;
}
public OnPlayerFakeKill(playerid, count)
{
return 1;
}
public OnPlayerMoneyChange(playerid, newmoney, oldmoney)
{
return 1;
}
public OnPlayerScoreChange(playerid, newscore, oldscore)
{
return 1;
}
public OnPlayerWalk(playerid, style)
{
return 1;
}
public OnPlayerHeadshot(playerid, issuerid, weaponid)
{
return 1;
}
public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
{
if(GodMode[playerid])//if the player has GOD mode ON
{
SetPlayerHealth(playerid, 10000.0);
}
return 1;
}
public OnPlayerAmmoChange(playerid, weaponid, newammo, oldammo)
{
if(weaponid == 34) return 0;
return 1;
}
#define ANTI_FAKE_KILL //comment this if you don't want anti fake kill system
public OnPlayerMoneyChange(playerid, newmoney, oldmoney);
public OnPlayerScoreChange(playerid, newscore, oldscore);
public OnPlayerKillPlayer(playerid, killerid, weaponid)
{
return 1;
}
pawn Code:
lol |
public OnPlayerDeath(playerid, killerid, reason)
{
if( killerid != INVALID_PLAYER_ID &&
playerid != INVALID_PLAYER_ID &&
! IsPlayerNPC(killerid) &&
! IsPlayerNPC(playerid))
{
reason = GetPlayerWeapon(killerid);
if(! IsValidWeapon(reason)) reason = 0;
CallLocalFunction("OnPlayerKillPlayer", "iii", playerid, killerid, reason);
}
return 1;
}
Ah, okay. Nice btw. I have a suggestion, you can add a "fakekill" parameter to OnPlayerKillPlayer which will make it more useful.
|
This are same like other SA-MP includes. ._. nothing changed at all.!
|
Make these macros:
GetPlayerPausedTime(playerid) IsPlayerPaused(playerid) GivePlayerScore(playerid, score) - Set Player Score already has an internal IsPlayerConnected SetPlayerMoney(playerid, money) |
If a bullet was shot then the ammo will obviously change unless its a hacker.I don't see any use of OnPlayerAmmoChange.
|
IsPlayerBehindPlayer(playerid, targetid, Float:range = 10.0)
This won't work. |
GetPlayerConnectedTime(playerid, &hours, &minutes, &seconds)
There is an equivalent function https://sampwiki.blast.hk/wiki/NetStats_GetConnectedTime |
Anyway there are some useful functions in the include.
Good Work!! |