Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define DIALOG_CORES_LASER 10000 // DIALOG DO CMD:CoresLaser
- #define LASER_VERMELHO 18643 // COR VERMELHA
- #define LASER_AZUL 19080 // COR AZUL
- #define LASER_VERDE 19083 // COR VERDE
- #define LASER_ROSA 19081 // COR ROSA
- #define LASER_LARANJA 19082 //COR LARANJA
- #define LASER_AMARELO 19084 // COR AMARELO
- public OnFilterScriptInit() {
- // print("\n-- Laser Pointer by Skiaffo --\n");
- new p = GetMaxPlayers();
- for (new i=0; i < p; i++) {
- SetPVarInt(i, "laser", 0);
- SetPVarInt(i, "color", LASER_VERMELHO); //COR PADRÃO: VERMELHA.
- }
- return 1;
- }
- public OnFilterScriptExit() {
- new p = GetMaxPlayers();
- for (new i=0; i < p; i++) {
- SetPVarInt(i, "laser", 0);
- RemovePlayerAttachedObject(i, 0);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- if (!GetPVarInt(playerid, "color")) SetPVarInt(playerid, "color", 18643);
- }
- public OnPlayerDisconnect(playerid) {
- SetPVarInt(playerid, "laser", 0);
- RemovePlayerAttachedObject(playerid, 0);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_CORES_LASER){
- if(response){
- switch(listitem){
- case 0:{
- SetPVarInt(playerid, "color", LASER_VERMELHO); // VERMELHO
- SendClientMessage(playerid, 0xFFFFFFFF, "* Cor do Laser alterada para {FF0000}Vermelho{FFFFFF}!");
- }
- case 1:{
- SetPVarInt(playerid, "color", LASER_AZUL); // AZUL
- SendClientMessage(playerid, 0xFFFFFFFF, "* Cor do Laser alterada para {008DF9}Azul{FFFFFF}!");
- }
- case 2:{
- SetPVarInt(playerid, "color", LASER_VERDE);
- SendClientMessage(playerid, 0xFFFFFFFF, "* Cor do Laser alterada para {3ED407}Verde{FFFFFF}!");
- }
- case 3:{
- SetPVarInt(playerid, "color", LASER_ROSA);
- SendClientMessage(playerid, 0xFFFFFFFF, "* Cor do Laser alterada para {FF00E6}Rosa{FFFFFF}!");
- }
- case 4:{
- SetPVarInt(playerid, "color", LASER_LARANJA);
- SendClientMessage(playerid, 0xFFFFFFFF, "* Cor do Laser alterada para {FFB700}Laranja{FFFFFF}!");
- }
- case 5:{
- SetPVarInt(playerid, "color", LASER_AMARELO);
- SendClientMessage(playerid, 0xFFFFFFFF, "* Cor do Laser alterada para {FFFC00}Amarelo{FFFFFF}!");
- }
- }
- }
- return 1;
- }
- return 1;
- }
- CMD:arma(playerid,params[]){
- if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF, "/Arma [ArmaID]");
- return GivePlayerWeapon(playerid,strval(params),300);
- }
- CMD:laseron(playerid, params[]) {
- SetPVarInt(playerid, "laser", 1);
- SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));
- SendClientMessage(playerid, 0xFFFFFFFF, "* Laser ativado! Para desativar use: {FF0000}/LaserOff{FFFFFF}");
- return 1;
- }
- CMD:laseroff(playerid, params[]) {
- SetPVarInt(playerid, "laser", 0);
- RemovePlayerAttachedObject(playerid, 0);
- SendClientMessage(playerid, 0xFFFFFFFF, "* Laser {FF0000}Desativado{FFFFFF}!");
- return 1;
- }
- CMD:coreslaser(playerid){
- if(!GetPVarInt(playerid, "laser")) return SendClientMessage(playerid, 0xFFFFFFFF, "* Você não ativou o Laser, use: {FF0000}/LaserOn{FFFFFF}");
- ShowPlayerDialog(playerid, DIALOG_CORES_LASER, DIALOG_STYLE_LIST, "Laser - Cores",
- "{FF0000}Vermelho\n\
- {008DF9}Azul\n\
- {3ED407}Verde\n\
- {FF00E6}Rosa\n\
- {FFB700}Laranja\n\
- {FFFC00}Amarelo\n",
- "Escolher", "Cancelar");
- return 1;
- }
- public OnPlayerUpdate(playerid) {
- if (GetPVarInt(playerid, "laser")) {
- 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)) {
- return 1;
- } 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement