Így próbáld meg:
public OnPlayerUpdate(playerid)
{
if(InPick[playerid] == 1)
{
if(!IsPlayerInRangeOfPoint(playerid,2.0,pickp[0],pickp[1],pickp[2]))
{
InPick[playerid] = 0;
}
}
if(trafi[playerid][0] == 1)
{
new Float:xt,Float:yt,Float:zt;
GetPlayerPos(playerid,xt,yt,zt);
foreach(Player, p)
{
if(p != playerid)
{
if(IsPlayerInRangeOfPoint(p, 10.0, xt, yt, zt))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(p);
if(GetVehicleSpeed(vid) > trafi[playerid][1])
{
if(trafizva[playerid] != 1)
{
TextDrawShowForPlayer(p,flash);
SetTimerEx(\"RemoveFlash\",1200,false,\"i\",p);
SendClientMessage(p, Red, \" - | Lekapott a trafipax! | -\");
SendFormattedMessage(p,HSARGA, \"- | Sebességed: %d km/h | Megengedett sebesség: %d km/h | Bírság: %d Ft | -\", GetVehicleSpeed(vid), trafi[playerid][1], GetPlayerBirsag(GetVehicleSpeed(vid)));
SendClientMessage(p, Red, \"- | -------------------- | -\");
GivePlayerMoney(p, -GetPlayerBirsag(GetVehicleSpeed(vid)));
trafizva[playerid] = 1;
SendFormattedMessage(playerid,HSARGA,\"Valakit sikerült lekapnod! Fizetésedhez hozzáadva: %d Ft\",GetPlayerBirsag(GetVehicleSpeed(vid)));
PlayerInfo[playerid][pFizu] += GetPlayerBirsag(GetVehicleSpeed(vid));
SetTimerEx(\"Trafile\",minute(2),0,\"i\",playerid);
}
}
}
}
}
}
}
if(jobbgomb[playerid] == 1)
{
new wid = GetPlayerWeapon(playerid);
if(wid > 10)
{
for(new NPCID; NPCID < MAX_PLAYERS; NPCID++)
{
if(!IsPlayerConnected(NPCID) || !IsPlayerNPC(NPCID)) continue;
if(KilledNPC[NPCID] == 0)
{
if(IsPlayerFacingPlayer(playerid,NPCID,10) == 1)
{
if(kezfent[NPCID] != 1)
{
ApplyAnimation(NPCID,\"ped\",\"handsup\",4.1,0,1,1,1,0);
kezfent[NPCID] = 1;
}
}
else
{
ClearAnimations(NPCID);
kezfent[NPCID] = 0;
}
}
}
}
}
new Float:hp;
GetPlayerHealth(playerid, hp);
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid)
{
GetVehicleHealth(vehicleid, hp);
if(hp != vhealth[playerid])
{
if(hp < vhealth[playerid]) OnVehicleLoseHealth(playerid, vehicleid, floatround(vhealth[playerid] - hp));
vhealth[playerid] = hp;
}
GetVehicleVelocity(vehicleid, velX[playerid], velY[playerid], velZ[playerid]);
}
if(tazerkezbe[playerid] == 1)
{
if(GetPlayerWeapon(playerid) != 0)
{
RemovePlayerAttachedObject(playerid, 5);
}
else
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,5))
{
SetPlayerAttachedObject(playerid, 5,18642, 5, 0.12, 0.02, -0.05, 0, 0, 45,1,1,1);
}
}
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(sebesseg[playerid] != 0)
{
new vid = GetPlayerVehicleID(playerid);
if(GetVehicleSpeed(vid) > sebesseg[playerid]/2)
{
SetVehicleSpeed(vid, sebesseg[playerid]/2);
}
}
}
GetPlayerHealth(playerid,gTmp);
if(pOldHealth[playerid]>gTmp)
{
FadeColorForPlayer(playerid,255,0,0,floatround(pOldHealth[playerid]-gTmp)*10,255,0,0,0,floatround(pOldHealth[playerid]-gTmp),0);
}
pOldHealth[playerid]=gTmp;
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleVelocity(GetPlayerVehicleID(playerid),gtemp[0],gtemp[1],gtemp[2]);
gtemp[3]=floatsqroot( floatmul(gtemp[0],gtemp[0])+floatmul(gtemp[1],gtemp[1])+floatmul(gtemp[2],gtemp[2]) )*100;
if(vSpeed[playerid]-gtemp[3]>20)FadeColorForPlayer(playerid,255,0,0,(floatround(vSpeed[playerid]-gtemp[3])-20)*3,255,0,0,0,floatround(vSpeed[playerid]-gtemp[3])-20,0);
vSpeed[playerid]=gtemp[3];
}
new Float:armour[MAX_PLAYERS];
GetPlayerArmour(playerid, armour[playerid]);
if(!IsPlayerNPC(playerid))
{
if( armour[playerid] > 0.0 )
{
SetPlayerAttachedObject( playerid, ARMOUR_INDEX, 19142, 1, 0.085266, 0.042019, -0.000281, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // SWATArmour1 - 2
}
else if( armour[playerid] == 0.0 && IsPlayerAttachedObjectSlotUsed(playerid, ARMOUR_INDEX))
{
RemovePlayerAttachedObject(playerid, ARMOUR_INDEX); // armour
}
}
if(GetTickCount() - armedbody_pTick[playerid] > 113)
{
//prefix check itter
new
weaponid[13],weaponammo[13],pArmedWeapon;
pArmedWeapon = GetPlayerWeapon(playerid);
GetPlayerWeaponData(playerid,1,weaponid[1],weaponammo[1]);
GetPlayerWeaponData(playerid,2,weaponid[2],weaponammo[2]);
GetPlayerWeaponData(playerid,4,weaponid[4],weaponammo[4]);
GetPlayerWeaponData(playerid,5,weaponid[5],weaponammo[5]);
#if ARMEDBODY_USE_HEAVY_WEAPON
GetPlayerWeaponData(playerid,7,weaponid[7],weaponammo[7]);
#endif
if(weaponid[1] && weaponammo[1] > 0)
{
if(pArmedWeapon != weaponid[1])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,0))
{
SetPlayerAttachedObject(playerid,0,GetWeaponModel(weaponid[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000);
}
}
else
{
if(IsPlayerAttachedObjectSlotUsed(playerid,0))
{
RemovePlayerAttachedObject(playerid,0);
}
}
}
else if(IsPlayerAttachedObjectSlotUsed(playerid,0))
{
RemovePlayerAttachedObject(playerid,0);
}
if(weaponid[2] && weaponammo[2] > 0)
{
if(pArmedWeapon != weaponid[2])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,1))
{
SetPlayerAttachedObject(playerid,1,GetWeaponModel(weaponid[2]),8, -0.079999, -0.039999, 0.109999, -90.100006, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
}
}
else
{
if(IsPlayerAttachedObjectSlotUsed(playerid,1))
{
RemovePlayerAttachedObject(playerid,1);
}
}
}
else if(IsPlayerAttachedObjectSlotUsed(playerid,1))
{
RemovePlayerAttachedObject(playerid,1);
}
if(weaponid[4] && weaponammo[4] > 0)
{
if(pArmedWeapon != weaponid[4])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,2))
{
SetPlayerAttachedObject(playerid,2,GetWeaponModel(weaponid[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000);
}
}
else
{
if(IsPlayerAttachedObjectSlotUsed(playerid,2))
{
RemovePlayerAttachedObject(playerid,2);
}
}
}
else if(IsPlayerAttachedObjectSlotUsed(playerid,2))
{
RemovePlayerAttachedObject(playerid,2);
}
if(weaponid[5] && weaponammo[5] > 0)
{
if(pArmedWeapon != weaponid[5])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,3))
{
SetPlayerAttachedObject(playerid,3,GetWeaponModel(weaponid[5]),1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
}
}
else
{
if(IsPlayerAttachedObjectSlotUsed(playerid,3))
{
RemovePlayerAttachedObject(playerid,3);
}
}
}
else if(IsPlayerAttachedObjectSlotUsed(playerid,3))
{
RemovePlayerAttachedObject(playerid,3);
}
#if ARMEDBODY_USE_HEAVY_WEAPON
if(weaponid[7] && weaponammo[7] > 0)
{
if(pArmedWeapon != weaponid[7])
{
if(!IsPlayerAttachedObjectSlotUsed(playerid,4))
{
SetPlayerAttachedObject(playerid,4,GetWeaponModel(weaponid[7]),1,-0.100000, 0.000000, -0.100000, 84.399932, 112.000000, 10.000000, 1.099999, 1.000000, 1.000000);
}
}
else
{
if(IsPlayerAttachedObjectSlotUsed(playerid,4))
{
RemovePlayerAttachedObject(playerid,4);
}
}
}
else if(IsPlayerAttachedObjectSlotUsed(playerid,4))
{
RemovePlayerAttachedObject(playerid,4);
}
#endif
armedbody_pTick[playerid] = GetTickCount();
}
new Float:health[MAX_PLAYERS];
GetPlayerHealth(playerid,health[playerid]);
if(health[playerid] < 3)
{
SetPlayerHealth(playerid,0);
SetPlayerHealth(playerid,5);
SetPlayerHealth(playerid,0);
}
return 1;
}
public CheckPlayers()
{
foreach(Player, i)
{
new Float:x,Float:y,Float:z;
new Float:x1,Float:y1,Float:z1;
new drogos = GetPlayerID(\"Drogos_Gyalogos\");
new boltos = GetPlayerID(\"Charlotte_Topkins\");
GetPlayerPos(drogos,x,y,z);
GetPlayerPos(boltos,x1,y1,z1);
new playerid = i;
new penz[16];
format(penz, 16, \"Ft %08d\", PlayerInfo[playerid][pMoney]);
PlayerTextDrawSetString(playerid,PenzBox[playerid], penz);
if(GetPlayerMoneyEx(playerid)>10)
{
new msg[128];
format(msg,128,\"%st bannolta a rendszer.Indok: Pénz Cheat!\",GetName(playerid));
SendClientMessageToAll(HPIROS,msg);
PlayerInfo[playerid][pLock]=1;
print(msg);
BanEx(playerid,\"Pénz Cheat\");
}
Antiweap_ON(playerid);
if(PlayerInfo[playerid][pMission] != 0 && PlayerInfo[playerid][pMission] != 5 && PlayerInfo[playerid][pMission] != 3 && PlayerInfo[playerid][pMission] != 4)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
PlayerInfo[playerid][pMission] = 5;
DestroyVehicle(ktrailer[playerid]);
SendClientMessage(playerid, Red, \"Elhagytad a pótkocsid! A küldetés véget ért, vidd vissza a kamiont a helyére!\");
SetPlayerCheckpoint(playerid,1082.0374,-297.3177,74.5982,7);
}
}
}
if(GetPlayerSpeed(playerid)>165)
{
new speed=GetPlayerSpeed(playerid);
new mig[128];
format(mig,128,\"[ADMINOK FIGYELEM] %s elért sebessége || %dKM/H || nézz utána!! ( /Spec %d )\",GetName(playerid),speed,playerid);
SAM(1,mig);
print(mig);
}
if(!IsPlayerNPC(playerid))
{
if(IsPlayerConnected(playerid))
{
if(KilledNPC[playerid] != 1)
{
if(IsPlayerInRangeOfPoint(playerid,2.0,x,y,z))
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
{
if(drogosnale[playerid] == 0)
{
ProxDetector(5.0, drogos, \"Mike Reyley mondja: Jónapot uram! Egzotikus illatszereket árulok, most jöttem fel friss levegõt szívni! Remélem nem baj.\", COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
SetPlayerChatBubble(drogos, \"Jónapot uram! Egzotikus illatszereket árulok, most jöttem fel friss levegõt szívni! Remélem nem baj.\", COLOR_WHITE, 5.0, 7000);
drogosnale[playerid] = 1;
SetTimerEx(\"dumanpc\",minute(1),0,\"i\",playerid);
}
return 1;
}
if(drogosnale[playerid] == 0)
{
drogosnale[playerid] = 1;
ProxDetector(5.0, drogos, \"Mike Reyley mondja: Na mivan tesa, mi kéne? ((/drogvesz))\", COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);
SetPlayerChatBubble(drogos, \"Na mivan tesa, kéne egy kis cuccos? Nálam megkapod!\", COLOR_WHITE, 5.0, 7000);
SetTimerEx(\"dumanpc\",minute(1),0,\"i\",playerid);
}
return 1;
}
}
}
}
if(PlayerInfo[playerid][pRpWarn]>4)
{
HU(playerid,FEHER,\"Bannolva lettél mivel nem tudod az RP szabályokat.\");
HU(playerid,ZOLD,\"Vedd fel az adminokkal a kapcsolatot, és kérj unbannt.\");
HU(playerid,PIROS,\"Tanuld meg a szabályokat.\");
BanEx(playerid,\"Warnok\");
return 1;
}
}
return 1;
}