21.12.2013, 22:53
Quote:
the whole callback posted would be quite useful brah
@ emmet: I think that's just a part of his code, but I might be wrong. |
You sure you want whole code. Its massive.... Here it is.
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerConnected(playerid) && IsPlayerLoggedIn(playerid))
{
if(GetPVarInt(playerid, "laser") == 1)
{
RemovePlayerAttachedObject(playerid, 0);
if ((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
switch (GetPlayerWeapon(playerid))
{
case 23:
{
if (IsPlayerAiming(playerid))
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing aiming
0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched aiming
0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
}
}
else
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing not aiming
0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched not aiming
0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
}
}
}
case 27:
{
if (IsPlayerAiming(playerid))
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing aiming
0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched aiming
0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
}
}
else
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing not aiming
0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched not aiming
0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
}
}
}
case 30:
{
if (IsPlayerAiming(playerid))
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing aiming
0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched aiming
0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
}
}
else
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing not aiming
0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched not aiming
0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
}
}
}
case 31:
{
if (IsPlayerAiming(playerid))
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing aiming
0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched aiming
0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
}
}
else
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing not aiming
0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched not aiming
0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
}
}
}
case 29:
{
if (IsPlayerAiming(playerid))
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing aiming
0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched aiming
0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
}
}
else
{
if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK)
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing not aiming
0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
}
else
{
SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched not aiming
0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
}
}
}
}
}
// Boxing
if(Boxing[playerid] && !BoxTime)
{
new string[128];
new Float:bH; GetPlayerHealth(playerid, bH);
if(bH <= 20)
{
// Getting other boxer's ID
new playerb = -1;
foreach(Player, i)
{
if(Boxing[i] && i != playerid) playerb = i;
}
if(playerb != -1)
{
format(string, sizeof(string), "Boxing Ring: The boxing match has ended, %s has won the match.", RPN(playerb));
SendGymMessage(COLOR_WHITE, string);
// Putting them out of the ring
SetPlayerPos(playerb, 760.9759,4.7187,1000.7084);
SetPlayerFacingAngle(playerb, 268.9407);
SetPlayerPos(playerid, 760.9759,6.1794,1000.7093);
SetPlayerFacingAngle(playerid, 268.9407);
// Giving the winner extra skill point
new oldj = strval(RPJL(playerb, JOB_BOXER));
PlayerInfo[playerb][pJobSkill][JOB_BOXER] ++;
new newj = strval(RPJL(playerb, JOB_BOXER));
if(oldj < newj)
{
format(string, sizeof(string), "** Your Boxer level is now %d, you can now cause %d more damage. **", newj, (newj*2)-2);
SendClientMessage(playerb, COLOR_YELLOW, string);
}
//
SendClientMessage(playerb, COLOR_LIME, " You have won the boxing match.");
SendClientMessage(playerid, COLOR_LIGHTRED, " You have lost the boxing match.");
// Giving Bids
new winner = pBoxer[playerb];
foreach(Player, i)
{
if(BidBoxer[i] == winner)
{
new percent, profit;
percent = (BidAmount[i]/BoxerBid[winner]) * 100;
profit = (percent * BoxerBid[pBoxer[playerid]]) / 100;
GiveDodMoney(i, BidAmount[i] + profit);
format(string, sizeof(string), " You have won $%d from bidding in the match, the money you bid has been returned as well.", profit);
SendClientMessage(i, COLOR_LIME, string);
}
BidAmount[i] = 0;
BidBoxer[i] = 0;
}
for(new w = 0; w < 13; w++)
{
GiveDodWeapon(playerb, PlayerInfo[playerb][pWeapon][w], PlayerInfo[playerb][pWeaponAmmo][w]);
}
}
for(new w = 0; w < 13; w++)
{
GiveDodWeapon(playerid, PlayerInfo[playerid][pWeapon][w], PlayerInfo[playerid][pWeaponAmmo][w]);
}
// Resetting Values
BoxingMatch = 0;
Boxer[1] = -1;
pBoxer[playerb] = 0;
Boxer[2] = -1;
pBoxer[playerid] = 0;
Boxing[playerb] = 0;
Boxing[playerid] = 0;
BoxerBid[1] = 0;
BoxerBid[2] = 0;
}
}
// Spikes
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(!IsACop(playerid))
{
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
{
if(SpikeInfo[i][sCreated] == 1)
{
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
tires = encode_tires(1, 1, 1, 1);
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
}
}
}
}
}
// Fuel
new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && Fuel[vehicleid] <= 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective, string[128];
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine)
{
SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
{SetVehicleParamsEx(vehicleid, 0, 0, 0, PlayerInfo[playerid][vLocked], 0, 0, 0);}
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
{SetVehicleParamsEx(vehicleid, 0, 0, 0, PlayerInfo[playerid][vVLocked], 0, 0, 0);}
format(string, sizeof(string), "* %s's vehicle stops as it has no fuel in its tank.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
}
// Drag
if(Dragged[playerid] != -1)
{
new playerb = Dragged[playerid];
new Float:pos[3];
GetPlayerPos(playerb, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0]+0.5, pos[1]+0.5, pos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(playerb));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(playerb));
}
// AntiCS
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(CheckCrouch[playerid] == 1) {
switch(WeaponID[playerid]) {
case 23..25, 27, 29..34, 41: {
if((Keys & KEY_CROUCH) && !((Keys & KEY_FIRE) || (Keys & KEY_HANDBRAKE)) && GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK ) {
if(Ammo[playerid][GetPlayerWeapon(playerid)] > GetPlayerAmmo(playerid)) {
// OnPlayerCBug(playerid);
}
}
//else SendClientMessage(playerid, COLOR_RED, "Failed in onplayer update");
}
}
}
if(!ud && !lr) { NotMoving[playerid] = 1; /*OnPlayerKeyStateChange(playerid, Keys, 0);*/ }
else { NotMoving[playerid] = 0; /*OnPlayerKeyStateChange(playerid, Keys, 0);*/ }
// Alt-Tab detection
AltTabbed[playerid] = 0;
// Speedlimit
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && Speedlimit[playerid])
{
new a, b, c;
GetPlayerKeys(playerid, a, b ,c);
if(a == 8 && GetVehicleSpeed(GetPlayerVehicleID(playerid), 0) > Speedlimit[playerid])
{
new newspeed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0) - Speedlimit[playerid];
ModifyVehicleSpeed(GetPlayerVehicleID(playerid), -newspeed);
}
}
// Ping Update
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
{
new string[64];
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~%s's Ping: ~w~%d", RPN(Specid[playerid]), GetPlayerPing(Specid[playerid]));
GameTextForPlayer(playerid, string,1000, 3);
}
// Money Anticheat
if(GetPlayerMoney(playerid) != PlayerInfo[playerid][pMoney])
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
}
// Speedometer
if(Speedo[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new string[64], speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Speedometer: ~w~%d MPH", speed);
GameTextForPlayer(playerid, string,1000, 3);
}
CheatsUpdate(playerid); //Updates the cheats
}
if(IsPlayerInAnyVehicle(playerid) && IsAAdmin(playerid) && IsAFlight(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
if(speed > 205 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 519 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 553 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 592 && IsAAdmin(playerid) || speed > 240)
{
new string[128];
format(string, sizeof(string), "AdmWarn: %s might be using speed hacks (%d MPH)", RPN(playerid), speed);
SendAdminMessage(COLOR_DARKRED, 1, string);
}
}
// Fuel
if(fMeter[playerid] && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new string[64];
format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~w~Fuel: ~g~%d%", Fuel[GetPlayerVehicleID(playerid)]);
GameTextForPlayer(playerid, string,1000, 3);
}
}
return 1;//Line 26328
}