/* Soly isPlayerAndroid(playerId) setDeviceInfo(playerId, deviceType) isInvalidObject(modelId) */ #define SONY // ÇÀÊÎÌÅÍÒÈÒÜ ÅÑËÈ ÂÑÅ = ÏÊ #define INVALID_OBJECTS_VERSION 0x3 #if defined _invalidobjects_included #endinput #endif #define _invalidobjects_included #if !defined PAWNCMD_INC_ #error "plz include Pawn.RakNet" #endif #if defined RPC_CREATE_OBJECT #undef RPC_CREATE_OBJECT #define RPC_CREATE_OBJECT 44 #else #define RPC_CREATE_OBJECT 44 #endif #if defined RPC_WORLDVEHICLE_ADD #undef RPC_WORLDVEHICLE_ADD #define RPC_WORLDVEHICLE_ADD 164 #else #define RPC_WORLDVEHICLE_ADD 164 #endif #if defined RPC_SET_PLAYER_SKIN #undef RPC_SET_PLAYER_SKIN #define RPC_SET_PLAYER_SKIN 153 #else #define RPC_SET_PLAYER_SKIN 153 #endif #if defined RPC_CLIENT_JOIN #undef RPC_CLIENT_JOIN #define RPC_CLIENT_JOIN 25 #else #define RPC_CLIENT_JOIN 25 #endif #if defined RPC_CREATE_PICKUP #undef RPC_CREATE_PICKUP #define RPC_CREATE_PICKUP 95 #else #define RPC_CREATE_PICKUP 95 #endif #define PICKUP_REPLACE_MODEL 1239 #define PLAYER_DEVICE_PC 0 #define PLAYER_DEVICE_ANDROID 1 enum E_CLIENT_KEY { e_clientVersion, e_szAuthKey[44] } static const stock m_szClientVersions[][E_CLIENT_KEY] = { {90, "E02262CF28BC542486C558D4BE9EFB716592AFAF8B"// INT32 byteMod, // UINT8 byteNicknameLen, // UINT8 NickName[MAX_PLAYER_NAME], // char uiClientChallengeResponse, // UINT32 byteAuthKeyLen, // UINT8 auth_key[64], // char iClientVerLen, // UINT8 ClientVersion[12] // char }; enum E_PICKUP_STRUCT { dPickupID, // UINT32 dModelID, // UINT32 dSpawnType, // UINT32 Float:pickupX, // FLOAT Float:pickupY, // FLOAT Float:pickupZ // FLOAT }; enum E_OBJECT_STRUCT { e_wObjectID, // INT16 e_ModelID, // UINT32 Float:e_objectX, // FLOAT Float:e_objectY, // FLOAT Float:e_objectZ, // FLOAT Float:e_rotx, // FLOAT Float:e_roty, // FLOAT Float:e_rotz, // FLOAT float:e_DrawDistance, // FLOAT e_NoCameraCol, // UINT8 e_attachedObject, // UINT16 e_attachedVehicle, // UINT16 float:e_AttachOffsetX, // FLOAT float:e_AttachOffsetY, // FLOAT float:e_AttachOffsetZ, // FLOAT float:e_AttachRotX, // FLOAT float:e_AttachRotY, // FLOAT float:e_AttachRotZ, // FLOAT e_SyncRotation // UINT8 }; enum E_VEHICLE_STRUCT { e_vVehicleID, // INT16 e_vModelID, // UINT32 Float:e_posX, Float:e_posY, Float:e_posZ, Float:e_rot, e_vColor1, e_vColor2, Float:e_vHealth, e_vInterior, e_vDoorDamageStatus, e_vPanelDamageStatus, e_vByteLightDamageStatus, e_vByteTimeDamageStatus, e_vByteAddSiren }; enum E_PLAYER_STRUCT { e_usPlayerID, e_bTeam, e_uiSkin, e_pfPosX, e_pfPosY, e_pfPosZ, e_pfRot, e_uiColor, e_bFighting, e_boolVisible }; static dataObject[E_OBJECT_STRUCT]; static vehicleData[E_VEHICLE_STRUCT]; static playerData[E_PLAYER_STRUCT]; static playerDevice[MAX_PLAYERS char]; stock isPlayerAndroid(playerId) { if(playerId == -1) return 1; return playerDevice{playerId}; } stock setDeviceInfo(playerId, deviceType) { playerDevice{playerId} = deviceType; return 1; } stock isValidVehicle(modelId) { if(isInvalidVehicle(modelId)) { if(getReplacableVehicleModel(modelId) == -1) { return 0; } } return 1; } stock isValidSkin(modelId) { if(isInvalidSkin(modelId)) { if(getReplacableSkinModel(modelId) == -1) { return 0; } } return 1; } stock isInvalidObject(modelId) { if(modelId < 11000) return -1; new returnval = -1; for(new it; it < sizeof(m_szSampModels); it++) { if(m_szSampModels[it] == modelId) { returnval = modelId; break; } } return returnval; } stock isInvalidVehicle(modelId) { if(modelId < 400 || modelId > 611) { return 1; } if(modelId < 15000 || modelId > 15100) { for(new i = 0; i < MAX_VEH_MODELS_REPLACE; i++) { if(vehModels[i][0] == modelId) { return 1; } } } else { return 1; } return 0; } stock getReplacableVehicleModel(modelId) { if(!(15_000 <= modelId <= 15_100)) { for(new i = 0; i < MAX_VEH_MODELS_REPLACE; i++) { if(vehModels[i][0] == modelId) { return vehModels[i][1]; } } } else return 412; return -1; } #define MAX_SERIAL_LENGTH 64 new g_usSAMPMajorVersions[MAX_PLAYERS]; new g_usSAMPMinorVersions[MAX_PLAYERS]; new g_bSAMPModified[MAX_PLAYERS]; new g_usLauncherVersion[MAX_PLAYERS]; new g_usModpackVersion[MAX_PLAYERS]; new g_szSerialNumbers[MAX_PLAYERS][MAX_SERIAL_LENGTH + 1]; new g_bUsesNewFormatData[MAX_PLAYERS]; stock isInvalidSkin(modelId) { if(modelId < 1 || modelId > 311) { return 1; } for(new i = 0; i < MAX_SKIN_MODELS_REPLACE; i++) { if(skinModels[i][0] == modelId) { return 1; } } return 0; } stock getReplacableSkinModel(modelId) { for(new i = 0; i < MAX_SKIN_MODELS_REPLACE; i++) { if(skinModels[i][0] == modelId) { return skinModels[i][1]; } } return -1; } #define MAX_OBJECT_MODELS_REPLACE 3 static objModels[MAX_OBJECT_MODELS_REPLACE] = { 1241, 13182, 9183 }; stock isInvalidObjectModel(modelId) { for(new i = 0; i < MAX_OBJECT_MODELS_REPLACE; i++) { if(objModels[i] == modelId) { return 1; } } return 0; } stock getReplacableObjectModel(modelId) { for(new i = 0; i < MAX_OBJECT_MODELS_REPLACE; i++) { if(objModels[i][0] == modelId) { return skinModels[i][1]; } } return -1; } #if defined _inc_y_hooks || defined _INC_y_hooks hook OnIncomingRPC(playerid, rpcid, BitStream:bs) #else public OnIncomingRPC(playerid, rpcid, BitStream:bs) #endif { if(rpcid == RPC_CLIENT_JOIN) { // Èãíîðèðóåì âñþ îáðàáîòêó äàííûõ è ñðàçó óñòàíàâëèâàåì íóæíûå çíà÷åíèÿ setDeviceInfo(playerid, 1); // Óñòàíàâëèâàåì óñòðîéñòâî êàê Android g_bUsesNewFormatData[playerid] = 1; // Èñïîëüçóåì íîâûé ôîðìàò äàííûõ setPlayerAndroidVers(playerid, 101); // Óñòàíàâëèâàåì âåðñèþ Android 101 } return 1; } #define OnIncomingRPC INCLUDE_OnIncomingRPC #if defined INCLUDE_OnIncomingRPC forward INCLUDE_OnIncomingRPC(playerid, rpcid, BitStream:bs); #endif #endif #define RPC_ScrGivePlayerWeapon 22 #define RPC_ScrSetPlayerAttachedObject 113 #define RPC_WorldPlayerAdd 32 stock ProcessReplaceSkin(playerid, BitStream:bs) { new player, skinid; BS_ReadValue( bs, PR_UINT32, player, PR_UINT32, skinid); if(isInvalidSkin(skinid)) { new bool: yes; for(new i; i < MAX_SKIN_MODELS_REPLACE; i++) { if(skinid == skinModels[i][0]) { if(getPlayerAndroidVers(playerid) < skinModels[i][2]) { new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_UINT32, player, //id PR_UINT32, 1); BS_RPC(bitstream, playerid, RPC_SET_PLAYER_SKIN, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); yes = true; break; } } } if(!yes) { // ïåðåïèñàòü ìîäåëü new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_UINT32, player, //id PR_UINT32, getReplacableSkinModel(skinid)); BS_RPC(bitstream, playerid, RPC_SET_PLAYER_SKIN, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); } return 1; } return 0; } /* enum E_PLAYER_STRUCT { e_usPlayerID, e_bTeam, e_uiSkin, e_pfPosX, e_pfPosY, e_pfPosZ, e_pfRot, e_uiColor, e_bFighting, e_boolVisible }; */ stock ProcessReplaceSkinAdd(playerid, BitStream:bs) { static clearPlayerData[E_PLAYER_STRUCT]; playerData = clearPlayerData; BS_ReadValue( bs, PR_INT16, playerData[e_usPlayerID], PR_UINT8, playerData[e_bTeam], PR_UINT32, playerData[e_uiSkin], PR_FLOAT, playerData[e_pfPosX], PR_FLOAT, playerData[e_pfPosY], PR_FLOAT, playerData[e_pfPosZ], PR_FLOAT, playerData[e_pfRot], PR_UINT32, playerData[e_uiColor], PR_UINT8, playerData[e_bFighting], PR_BOOL, playerData[e_boolVisible]); if(isInvalidSkin(playerData[e_uiSkin])) { new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_INT16, playerData[e_usPlayerID], PR_UINT8, playerData[e_bTeam], PR_UINT32, getReplacableSkinModel(playerData[e_uiSkin]), PR_FLOAT, playerData[e_pfPosX], PR_FLOAT, playerData[e_pfPosY], PR_FLOAT, playerData[e_pfPosZ], PR_FLOAT, playerData[e_pfRot], PR_UINT32, playerData[e_uiColor], PR_UINT8, playerData[e_bFighting], PR_BOOL, playerData[e_boolVisible]); BS_RPC(bitstream, playerid, RPC_WorldPlayerAdd, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); return 1; } return 0; } stock ProcessReplaceVehicle(playerid, BitStream:bs) { static clearVehicleData[E_VEHICLE_STRUCT]; vehicleData = clearVehicleData; new modSlots[14]; new bytePaintJob; new color1, color2; BS_ReadValue( bs, PR_INT16, vehicleData[e_vVehicleID], PR_UINT32, vehicleData[e_vModelID], PR_FLOAT, vehicleData[e_posX], PR_FLOAT, vehicleData[e_posY], PR_FLOAT, vehicleData[e_posZ], PR_FLOAT, vehicleData[e_rot], PR_UINT8, vehicleData[e_vColor1], PR_UINT8, vehicleData[e_vColor2], PR_FLOAT, vehicleData[e_vHealth], PR_UINT8, vehicleData[e_vInterior], PR_UINT32, vehicleData[e_vDoorDamageStatus], PR_UINT32, vehicleData[e_vPanelDamageStatus], PR_UINT8, vehicleData[e_vByteLightDamageStatus], PR_UINT8, vehicleData[e_vByteTimeDamageStatus], PR_UINT8, vehicleData[e_vByteAddSiren]); for(new i = 0; i < 14; i++) { BS_ReadValue(bs, PR_UINT8, modSlots[i]); } BS_ReadValue(bs, PR_UINT8, bytePaintJob); BS_ReadValue(bs, PR_UINT32, color1, PR_UINT32, color2); if(isInvalidVehicle(vehicleData[e_vModelID])) { new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_INT16, vehicleData[e_vVehicleID], PR_UINT32, getReplacableVehicleModel(vehicleData[e_vModelID]), PR_FLOAT, vehicleData[e_posX], PR_FLOAT, vehicleData[e_posY], PR_FLOAT, vehicleData[e_posZ], PR_FLOAT, vehicleData[e_rot], PR_UINT8, vehicleData[e_vColor1], PR_UINT8, vehicleData[e_vColor2], PR_FLOAT, vehicleData[e_vHealth], PR_UINT8, vehicleData[e_vInterior], PR_UINT32, vehicleData[e_vDoorDamageStatus], PR_UINT32, vehicleData[e_vPanelDamageStatus], PR_UINT8, vehicleData[e_vByteLightDamageStatus], PR_UINT8, vehicleData[e_vByteTimeDamageStatus], PR_UINT8, vehicleData[e_vByteAddSiren]); for(new i = 0; i < 14; i++) { BS_WriteValue(bitstream, PR_UINT8, modSlots[i]); } BS_WriteValue(bitstream, PR_UINT8, bytePaintJob); BS_WriteValue(bitstream, PR_UINT32, color1, PR_UINT32, color2); BS_RPC(bitstream, playerid, RPC_WORLDVEHICLE_ADD, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); return 1; } return 0; } /* stock ProcessReplaceVehicle(playerid, BitStream:bs) { static clearVehicleData[E_VEHICLE_STRUCT]; vehicleData = clearVehicleData; new modSlots[14]; new bytePaintJob; new color1, color2; BS_ReadValue( bs, PR_INT16, vehicleData[e_vVehicleID], PR_UINT32, vehicleData[e_vModelID], PR_FLOAT, vehicleData[e_posX], PR_FLOAT, vehicleData[e_posY], PR_FLOAT, vehicleData[e_posZ], PR_FLOAT, vehicleData[e_rot], PR_UINT8, vehicleData[e_vColor1], PR_UINT8, vehicleData[e_vColor2], PR_FLOAT, vehicleData[e_vHealth], PR_UINT8, vehicleData[e_vInterior], PR_UINT32, vehicleData[e_vDoorDamageStatus], PR_UINT32, vehicleData[e_vPanelDamageStatus], PR_UINT8, vehicleData[e_vByteLightDamageStatus], PR_UINT8, vehicleData[e_vByteTimeDamageStatus], PR_UINT8, vehicleData[e_vByteAddSiren]); for(new i = 0; i < 14; i++) { BS_ReadValue(bs, PR_UINT8, modSlots[i]); } BS_ReadValue(bs, PR_UINT8, bytePaintJob); BS_ReadValue(bs, PR_UINT32, color1, PR_UINT32, color2); if(isInvalidVehicle(vehicleData[e_vModelID])) { new bool: yes; for(new g; g < MAX_VEH_MODELS_REPLACE; g++) { if(vehicleData[e_vModelID] == vehModels[g][0]) { if(getPlayerAndroidVers(playerid) < vehModels[g][2]) { new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_INT16, vehicleData[e_vVehicleID], PR_UINT32, vehModels[g][1], PR_FLOAT, vehicleData[e_posX], PR_FLOAT, vehicleData[e_posY], PR_FLOAT, vehicleData[e_posZ], PR_FLOAT, vehicleData[e_rot], PR_UINT8, vehicleData[e_vColor1], PR_UINT8, vehicleData[e_vColor2], PR_FLOAT, vehicleData[e_vHealth], PR_UINT8, vehicleData[e_vInterior], PR_UINT32, vehicleData[e_vDoorDamageStatus], PR_UINT32, vehicleData[e_vPanelDamageStatus], PR_UINT8, vehicleData[e_vByteLightDamageStatus], PR_UINT8, vehicleData[e_vByteTimeDamageStatus], PR_UINT8, vehicleData[e_vByteAddSiren]); for(new i = 0; i < 14; i++) { BS_WriteValue(bitstream, PR_UINT8, modSlots[i]); } BS_WriteValue(bitstream, PR_UINT8, bytePaintJob); BS_WriteValue(bitstream, PR_UINT32, color1, PR_UINT32, color2); BS_RPC(bitstream, playerid, RPC_WORLDVEHICLE_ADD, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); yes = true; break; } } } if(!yes) { new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_INT16, vehicleData[e_vVehicleID], PR_UINT32, getReplacableVehicleModel(vehicleData[e_vModelID]), PR_FLOAT, vehicleData[e_posX], PR_FLOAT, vehicleData[e_posY], PR_FLOAT, vehicleData[e_posZ], PR_FLOAT, vehicleData[e_rot], PR_UINT8, vehicleData[e_vColor1], PR_UINT8, vehicleData[e_vColor2], PR_FLOAT, vehicleData[e_vHealth], PR_UINT8, vehicleData[e_vInterior], PR_UINT32, vehicleData[e_vDoorDamageStatus], PR_UINT32, vehicleData[e_vPanelDamageStatus], PR_UINT8, vehicleData[e_vByteLightDamageStatus], PR_UINT8, vehicleData[e_vByteTimeDamageStatus], PR_UINT8, vehicleData[e_vByteAddSiren]); for(new i = 0; i < 14; i++) { BS_WriteValue(bitstream, PR_UINT8, modSlots[i]); } BS_WriteValue(bitstream, PR_UINT8, bytePaintJob); BS_WriteValue(bitstream, PR_UINT32, color1, PR_UINT32, color2); BS_RPC(bitstream, playerid, RPC_WORLDVEHICLE_ADD, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); } return 1; } return 0; } */ stock IsShouldSendCreateObject(playerid, BitStream:bs) { //new dataObject[E_OBJECT_STRUCT]; static clearDataObject[E_OBJECT_STRUCT]; dataObject = clearDataObject; BS_ReadValue( bs, PR_INT16, dataObject[e_wObjectID], PR_UINT32, dataObject[e_ModelID], PR_FLOAT, dataObject[e_objectX], PR_FLOAT, dataObject[e_objectY], PR_FLOAT, dataObject[e_objectZ], PR_FLOAT, dataObject[e_rotx], PR_FLOAT, dataObject[e_roty], PR_FLOAT, dataObject[e_rotz], PR_FLOAT, dataObject[e_DrawDistance], PR_UINT8, dataObject[e_NoCameraCol], PR_UINT16, dataObject[e_attachedObject], PR_UINT16, dataObject[e_attachedVehicle], PR_FLOAT, dataObject[e_AttachOffsetX], PR_FLOAT, dataObject[e_AttachOffsetY], PR_FLOAT, dataObject[e_AttachOffsetZ], PR_FLOAT, dataObject[e_AttachRotX], PR_FLOAT, dataObject[e_AttachRotY], PR_FLOAT, dataObject[e_AttachRotZ], PR_UINT8, dataObject[e_SyncRotation] ); if(isInvalidObjectModel(dataObject[e_ModelID])) { return 0; } return 1; } stock IsShouldSendCreateAttached(playerid, BitStream:bs) { new sPlayerID, iSlot, bCreate; BS_ReadValue( bs, PR_UINT16, sPlayerID, PR_UINT32, iSlot, PR_BOOL, bCreate); if(bCreate) { new modelid; BS_ReadValue(bs, PR_UINT32, modelid); if(isInvalidObjectModel(modelid)) { return 0; } } return 1; } #define WEAPON_SECURE 0x100 #define WEAPON_SECURE_KEY 0x15 #if defined _inc_y_hooks || defined _INC_y_hooks hook OnOutcomingRPC(playerid, rpcid, BitStream:bs) #else public OnOutcomingRPC(playerid, rpcid, BitStream:bs) #endif { if(rpcid == RPC_CREATE_OBJECT) { if(isPlayerAndroid(playerid) != 0) // åñëè èãðîê ñ âåäðà { if(getPlayerAndroidVers(playerid) < server_invalid_client) // åñëè ó èãðîêà âåðñèÿ, êîòîðàÿ íèæå âåðñèè êëèåíòà ñ ëèìèòîì è ìîäïàêîì { if(!IsShouldSendCreateObject(playerid, bs)) // åñëè ìîäåëü íåâàëèäíàÿ, òî íå îòñûëàåì { new _frmtsrt[50]; format(_frmtsrt, sizeof(_frmtsrt), "[Warning] Bad object model: 32"); SendClientMessage(playerid, 0xa9c4e4FF, _frmtsrt); return 0; } } } else // èíà÷å èãðîê ñ ÏÊ { if(!IsShouldSendCreateObject(playerid, bs)) // åñëè ìîäåëü íåâàëèäíàÿ, òî íå îòñûëàåì { new _frmtsrt[50]; format(_frmtsrt, sizeof(_frmtsrt), "[Warning] Bad object model: 32"); SendClientMessage(playerid, 0xa9c4e4FF, _frmtsrt); return 0; } } } else if(rpcid == RPC_ScrGivePlayerWeapon) // ñåðâåðíàÿ çàùèòà { new val1, val2; BS_ReadValue( bs, PR_UINT32, val1, PR_UINT32, val2); new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_UINT32, val1, //id PR_UINT32, val2, //model PR_UINT32, WEAPON_SECURE ^ WEAPON_SECURE_KEY ); BS_RPC(bitstream, playerid, RPC_ScrGivePlayerWeapon, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); return 0; } else if(rpcid == RPC_ScrSetPlayerAttachedObject) { if(isPlayerAndroid(playerid) != 0) // åñëè èãðîê ñ âåäðà { if(getPlayerAndroidVers(playerid) < server_invalid_client) // åñëè ó èãðîêà âåðñèÿ, êîòîðàÿ íèæå âåðñèè êëèåíòà ñ ëèìèòîì è ìîäïàêîì { if(!IsShouldSendCreateAttached(playerid, bs)) // åñëè ìîäåëü íåâàëèäíàÿ, òî íå îòñûëàåì { new _frmtsrt[50]; format(_frmtsrt, sizeof(_frmtsrt), "[Warning] Bad object mode1: 33"); SendClientMessage(playerid, 0xa9c4e4FF, _frmtsrt); return 0; } } } else // èíà÷å èãðîê ñ ÏÊ { if(!IsShouldSendCreateAttached(playerid, bs)) // åñëè ìîäåëü íåâàëèäíàÿ, òî íå îòñûëàåì { new _frmtsrt[50]; format(_frmtsrt, sizeof(_frmtsrt), "[Warning] Bad object model: 33"); SendClientMessage(playerid, 0xa9c4e4FF, _frmtsrt); return 0; } } } else if(rpcid == RPC_WorldPlayerAdd) { if(isPlayerAndroid(playerid) != 0 && !gPlayerModPack[playerid]) // åñëè èãðîê ñ âåäðà { if(getPlayerAndroidVers(playerid) < server_invalid_client) // åñëè ó èãðîêà âåðñèÿ, êîòîðàÿ íèæå âåðñèè êëèåíòà ñ ëèìèòîì è ìîäïàêîì { if(ProcessReplaceSkinAdd(playerid, bs)) // åñëè ìîäåëü áûëà çàìåíåíà óñïåøíî, òî îðèãèíàëüíûé ïàêåò íå îòñûëàåì { return 0; } } } else // èíà÷å èãðîê ñ ÏÊ { if(ProcessReplaceSkinAdd(playerid, bs)) // åñëè ìîäåëü áûëà çàìåíåíà óñïåøíî, òî îðèãèíàëüíûé ïàêåò íå îòñûëàåì { return 0; } } } else if(rpcid == RPC_WORLDVEHICLE_ADD) { if(isPlayerAndroid(playerid) != 0 && !gPlayerModPack[playerid]) // åñëè èãðîê ñ âåäðà { if(getPlayerAndroidVers(playerid) < server_invalid_client) // åñëè ó èãðîêà âåðñèÿ, êîòîðàÿ íèæå âåðñèè êëèåíòà ñ ëèìèòîì è ìîäïàêîì { if(ProcessReplaceVehicle(playerid, bs)) // åñëè ìîäåëü áûëà çàìåíåíà óñïåøíî, òî îðèãèíàëüíûé ïàêåò íå îòñûëàåì { return 0; } } } else // èíà÷å èãðîê ñ ÏÊ { if(ProcessReplaceVehicle(playerid, bs)) // åñëè ìîäåëü áûëà çàìåíåíà óñïåøíî, òî îðèãèíàëüíûé ïàêåò íå îòñûëàåì { return 0; } } } else if(rpcid == RPC_SET_PLAYER_SKIN) { if(isPlayerAndroid(playerid) != 0 && !gPlayerModPack[playerid]) // åñëè èãðîê ñ âåäðà { if(getPlayerAndroidVers(playerid) < server_invalid_client) // åñëè ó èãðîêà âåðñèÿ, êîòîðàÿ íèæå âåðñèè êëèåíòà ñ ëèìèòîì è ìîäïàêîì { if(ProcessReplaceSkin(playerid, bs)) // åñëè ìîäåëü áûëà çàìåíåíà óñïåøíî, òî îðèãèíàëüíûé ïàêåò íå îòñûëàåì { return 0; } } } else // èíà÷å èãðîê ñ ÏÊ { if(ProcessReplaceSkin(playerid, bs)) // åñëè ìîäåëü áûëà çàìåíåíà óñïåøíî, òî îðèãèíàëüíûé ïàêåò íå îòñûëàåì { return 0; } } } else if(rpcid == RPC_CREATE_PICKUP) { if(isPlayerAndroid(playerid) != 0) { if(getPlayerAndroidVers(playerid) < server_invalid_client) { new dataPickup[E_PICKUP_STRUCT]; BS_ReadValue( bs, PR_UINT32, dataPickup[dPickupID], PR_UINT32, dataPickup[dModelID], PR_UINT32, dataPickup[dSpawnType], PR_FLOAT, dataPickup[pickupX], PR_FLOAT, dataPickup[pickupY], PR_FLOAT, dataPickup[pickupZ] ); if(isInvalidObject(dataPickup[dModelID]) != -1) { new _frmtsrt[50]; format(_frmtsrt, sizeof(_frmtsrt), "[Warning] Bad pickup model: %d(%d)", dataPickup[dModelID], dataPickup[dPickupID]); SendClientMessage(playerid, 0xa9c4e4FF, _frmtsrt); // ïåðåïèñàòü ìîäåëü new BitStream:bitstream = BS_New(); BS_WriteValue( bitstream, PR_UINT32, dataPickup[dPickupID], //id PR_UINT32, PICKUP_REPLACE_MODEL, //model PR_UINT32, dataPickup[dSpawnType], //type. PR_FLOAT, dataPickup[pickupX], //x. PR_FLOAT, dataPickup[pickupY], //y. PR_FLOAT, dataPickup[pickupZ] //z. ); BS_RPC(bitstream, playerid, RPC_CREATE_PICKUP, PR_HIGH_PRIORITY, PR_RELIABLE_SEQUENCED); BS_Delete(bitstream); return 0; } } } } #if defined INCLUDE_OnOutcomingRPC return INCLUDE_OnOutcomingRPC(playerid, rpcid, BitStream:bs); #else return 1; #endif } #if !defined _inc_y_hooks && !defined _INC_y_hooks #if defined _ALS_OnOutcomingRPC #undef OnOutcomingRPC #else #define _ALS_OnOutcomingRPC #endif #define OnOutcomingRPC INCLUDE_OnOutcomingRPC #if defined INCLUDE_OnOutcomingRPC forward INCLUDE_OnOutcomingRPC(playerid, rpcid, BitStream:bs); #endif #endif