10.12.2013, 09:10
i can't see the briefcase in game
And when i type for /laseron nothing happens?
How could i fix this.GIVE ME ONLY THE CODES WHAT TO REPLACE I AM NEWBIE!!!
Or to give me another script!?
And when i type for /laseron nothing happens?
How could i fix this.GIVE ME ONLY THE CODES WHAT TO REPLACE I AM NEWBIE!!!
Or to give me another script!?
Код:
//Tutriol By Jimmy Made by NoFeAr /************************************ | NoFeAr | | Briefcase system | | | ************************************/ #include <a_samp> #define COLOR_WHITE 0xFFFFFFFF #define MAX_BRIEF_CASE 20 static BriefCases[MAX_BRIEF_CASE] = { -1, ... }; stock CreateBriefCase(Float:x, Float:y, Float:z) { for(new i = 0; i < MAX_BRIEF_CASE; i++) { if(BriefCases[i] == -1) { BriefCases[i] = CreatePickup(1210, 1, 223.9407, 1860.5116, 13.1470, 0); BriefCases[i] = CreatePickup(1210, 1, -233.7510, 2654.8472, 62.6379, 0); BriefCases[i] = CreatePickup(1210, 1, -885.9767, 2784.6777, 47.2957, 0); BriefCases[i] = CreatePickup(1210, 1, -2244.8130, 2305.2415, 4.9691, 0); BriefCases[i] = CreatePickup(1210, 1, -790.9128, 1561.4110, 27.1172, 0); BriefCases[i] = CreatePickup(1210, 1, 1114.6312, 1730.8717, 10.8203, 0); BriefCases[i] = CreatePickup(1210, 1, -359.4244, 1175.0750, 19.7422, 0); BriefCases[i] = CreatePickup(1210, 1, -85.5241, 743.5977, 22.8342, 0); BriefCases[i] = CreatePickup(1210, 1, 403.2001, 2534.9236, 16.5456, 0); // Success return index return i; } } // Failed return -1; } // Deleted a briefcase stock DeleteBriefCase(index) { if(index >= 0 && index < MAX_BRIEF_CASE && BriefCases[index] != -1) { DestroyPickup(BriefCases[index]); BriefCases[index] = -1; return 1; } return 0; } // Check if a pickupid is a briefcase stock IsBriefCase(pickupid) { for(new i = 0; i < MAX_BRIEF_CASE; i++) { if(BriefCases[i] != -1) { // return the index where the briefcase was found if(BriefCases[i] == pickupid) return i; } } return -1; } public OnPlayerPickUpPickup(playerid, pickupid) { for(new i = 0; i < MAX_BRIEF_CASE; i++) if(pickupid == BriefCases[i]) { ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 777) { if(response) { if(listitem ==0) { if (GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); SetPlayerHealth(playerid, 100.0); SendClientMessage(playerid, COLOR_WHITE, "You bought Health for $5000!"); } if(listitem ==1) { if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -5000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); SetPlayerArmour(playerid, 100.0); SendClientMessage(playerid, COLOR_WHITE, "You bought Armour for $5000!"); } if(listitem ==2) { ShowPlayerDialog(playerid, 888, DIALOG_STYLE_LIST, "Weapons", "M4 - 6000$\nAK47 - 6000$\nMP5 - 5000$\nUZI - 10000$\nCombat Shotgun - 10000$\nShotgun - 5000$\nDesert Eagle - 7000$\nSilent Pistol - 3000$\nSniper-8000$\nTec 9 - 3000$\nSawn-Off Shotgun - 8000$\nRPG - 10000$", "Buy", "Exit"); } } } if(dialogid ==888) { if(response) { if(listitem==0) { if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -6000); GivePlayerWeapon(playerid, 31, 300); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); SendClientMessage(playerid,COLOR_WHITE, "You bought M4 with 300 Ammo."); } if(listitem==1) { if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -6000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 30, 300); SendClientMessage(playerid, COLOR_WHITE, "You bought AK 47 with 300 Ammo."); } if(listitem==2) { if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -5000); GivePlayerWeapon(playerid, 29, 300); SendClientMessage(playerid, COLOR_WHITE, "You bought MP5 with 300 Ammo."); } if(listitem==3) { if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -10000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 28, 500); SendClientMessage(playerid, COLOR_WHITE, "You bought UZI with 300 Ammo."); } if(listitem==4) { if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -10000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 27, 300); SendClientMessage(playerid, COLOR_WHITE, "You bought SPAZ12 with 300 Ammo."); } if(listitem==5) { if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -5000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 25, 300); SendClientMessage(playerid, COLOR_WHITE, "You bought Shotgun with 300 Ammo."); } if(listitem==6) { if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -7000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 24, 100); SendClientMessage(playerid, COLOR_WHITE, "You bought Desert Eagle with 100 Ammo."); } if(listitem==7) { if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -3000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 23, 300); SendClientMessage(playerid, COLOR_WHITE, "You bought Silencer with 300 Ammo."); } if(listitem==8) { if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -8000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 34,100); SendClientMessage(playerid, COLOR_WHITE, "You bought Sniper with 100 Ammo."); } if(listitem==9) { if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -3000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 32, 300); SendClientMessage(playerid, COLOR_WHITE, "You bought Tec 9 with 300 Ammo."); } if(listitem==10) { if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -8000); GivePlayerWeapon(playerid, 26, 100); SendClientMessage(playerid, COLOR_WHITE, "You bought Sawn off Shotgun with 100 Ammo."); } if(listitem==11) { if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: You don't have enough cash.") && ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerMoney(playerid, -10000); ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5000$\n\nWeapons", "Select", "Cancel"); GivePlayerWeapon(playerid, 35, 1); SendClientMessage(playerid, COLOR_WHITE, "You bought RPG with 1 Ammo."); } } } return 1; }
Код:
#include <a_samp> #include <foreach> #include <sscanf2> #include <zcmd> //==================================================== #define C_GREY 0xAFAFAFAA #define C_VIOLET 0x9955DEEE //==================================================== public OnFilterScriptInit() { foreach(new i: Player) { SetPVarInt(i, "laser", 0); SetPVarInt(i, "color", 18643); } return 1; } public OnFilterScriptExit() { foreach(new i: Player) { SetPVarInt(i, "laser", 0); RemovePlayerAttachedObject(i, 0); } return 1; } //==================================================== public OnPlayerSpawn(playerid) { if (!GetPVarInt(playerid, "color")) SetPVarInt(playerid, "color", 18643); } public OnPlayerDisconnect(playerid, reason) { RemovePlayerAttachedObject(playerid, 0); return 1; } //==================================================== CMD:laseron(playerid, params[]) { SetPVarInt(playerid, "laser", 1); SetPVarInt(playerid, "color", GetPVarInt(playerid, "color")); return 1; } CMD:laseroff(playerid, params[]) { SetPVarInt(playerid, "laser", 0); RemovePlayerAttachedObject(playerid, 0); return 1; } CMD:lasercol(playerid, params[]) { new color[16]; if(sscanf(params, "s[15]", color)) return SendClientMessage(playerid, C_GREY, "USAGE: /lasercol [color]"); if(!strcmp(color, "red", true)) SetPVarInt(playerid, "color", 18643); else if(!strcmp(color, "blue", true)) SetPVarInt(playerid, "color", 19080); else if(!strcmp(color, "pink", true)) SetPVarInt(playerid, "color", 19081); else if(!strcmp(color, "orange", true)) SetPVarInt(playerid, "color", 19082); else if(!strcmp(color, "green", true)) SetPVarInt(playerid, "color", 19083); else if(!strcmp(color, "yellow", true)) SetPVarInt(playerid, "color", 19084); else SendClientMessage(playerid, C_VIOLET, "Color not available!"); return 1; } public OnPlayerUpdate(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 34: { if (IsPlayerAiming(playerid)) { if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) { SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing aiming 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289); } else { SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper 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, // Sniper standing not aiming 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259); } else { SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched not aiming 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259); } } }*/ 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); } } } } } return 1; } stock IsPlayerInWater(playerid) { new anim = GetPlayerAnimationIndex(playerid); if (((anim >= 1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1; return 0; } stock IsPlayerAiming(playerid) { new anim = GetPlayerAnimationIndex(playerid); if (((anim >= 1160) && (anim <= 1163)) || (anim == 1167) || (anim == 1365) || (anim == 1643) || (anim == 1453) || (anim == 220)) return 1; return 0; }