Aller au contenu
San Andreas Multiplayer

Nitram

Donateurs
  • Compteur de contenus

    193
  • Contenu moyen par jour

    0,15
  • Points

  • Inscription

  • Dernière visite

  • Jours gagnés

    2

Nitram a gagné pour la dernière fois le 7 octobre 2016

Nitram a eu le contenu le plus aimé !

Réputation sur la communauté

32 Apprécié

1 abonné

À propos de Nitram

  • Rang
    Adepte
  • Date de naissance 28/02/1997

Compétences

  • Pawn
  • Web front-end
  • Web back-end
  • Mapping
  • Réseau
  • Graphisme

Visiteurs récents du profil

3 518 visualisations du profil
  1. Nitram

    Mon premier site web

    Moche.
  2. [Include] easyDialog.inc - Dialogs made easier! Voir le fichier Je post ici cette include car elle n'est plus disponible sur le forum officiel. Voici le post original de : Emmet_ http://forum.sa-mp.com/showthread.php?t=475838 easyDialog.incIntroductionI've released this include a little over a year ago. However, it didn't have many features and it wasn't crash proof, so I've decided to scrap it and rewrite the whole include from scratch.PurposeThe purpose of this include is to make dialogs easier to use in general.Imagine having over 100 dialog checks under OnDialogResponse. It's just too messy and most of the time, it's unorganized and harder to look for certain dialogs for future editing, and remembering certain dialog ID's can be a pain in the ass. However, easyDialog.inc fixes that by introducing a "named dialog feature" which allows scripters to declare a dialog by name, rather than ID. Feature OnDialogResponse easyDialog.inc Crash Proof No Yes Named Dialogs No Yes Calling a dialog manually No Yes Custom callback for handling No Yes This code: Code: #define DIALOG_WEAPON (1337) CMD:weapons(playerid, params[]) { ShowPlayerDialog(playerid, DIALOG_WEAPON, DIALOG_STYLE_LIST, "Weapon Menu", "9mm\nSilenced 9mm\nDesert Eagle\nShotgun\nSawn-off Shotgun\nCombat Shotgun", "Select", "Cancel"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_WEAPON) { if (response) { new str[64]; format(str, 64, "You have selected the '%s'.", inputtext); GivePlayerWeapon(playerid, listitem + 22, 500); SendClientMessage(playerid, -1, str); } } return 1; } Turns into this code: Code: CMD:weapons(playerid, params[]) { Dialog_Show(playerid, WeaponMenu, DIALOG_STYLE_LIST, "Weapon Menu", "9mm\nSilenced 9mm\nDesert Eagle\nShotgun\nSawn-off Shotgun\nCombat Shotgun", "Select", "Cancel"); return 1; } Dialog:WeaponMenu(playerid, response, listitem, inputtext[]) { if (response) { new str[64]; format(str, 64, "You have selected the '%s'.", inputtext); GivePlayerWeapon(playerid, listitem + 22, 500); SendClientMessage(playerid, -1, str); } return 1; } I think the second example is much more neater, especially for larger scripts.CallbackThis script introduces a new callback: Code: public OnDialogPerformed(playerid, dialog[], response, success) { return 1; } This callback is called before a dialog is shown to a player (using Dialog_Show, that is). Returning 0 under this callback will prevent the dialog from working. Code: public OnDialogPerformed(playerid, dialog[], response, success) { if (!strcmp(dialog, "WeaponMenu") && IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, -1, "You must be on-foot to spawn a weapon."); return 0; } return 1; } Very simple, isn't it?FunctionsThis include introduces several new useful functions: Code: Dialog_Show(playerid, dialog, style, caption[], info[], button1[], button2[]); Shows a dialog to a player. Code: Dialog_Close(playerid); Closes any opened dialogs. Code: Dialog_Opened(playerid); Returns 1 if the dialog is opened for the specified player.DownloadeasyDialog.inc (Pastebin)easyDialog.inc (Solidfiles)Example Script (Pastebin)Example Script (Solidfiles)This include doesn't work...a) Update to the newest versioneasyDialog was originally released in 2012, and the latest stable version was released on March 31, 2015. You must update to the latest version for the latest features and bug fixes. Code: // easyDialog v1.0 Syntax: ShowDialog(playerid, Show:MyDialog, DIALOG_STYLE_LIST, "List", "Items", "Select", "Cancel"); // easyDialog v2.0 Syntax: Dialog_Show(playerid, MyDialog, DIALOG_STYLE_LIST, "List", "Items", "Select", "Cancel"); easyDialog works in parallel with OnDialogResponse, so you can use both at the same time. Older versions do not support this.b) Includes and filterscriptsReturning 0 under OnDialogResponse will pass the dialog to other scripts containing the callback. However, certain filterscripts and third-party libraries might return 1 instead. This interferes with the inner workings of easyDialog and causes the dialogs to not work.Simply return 0 instead to fix the issue. Contributeur Nitram Soumis 16/09/2018 Catégorie Plugins & Includes Pastebin Github  
  3. Version 1.0.0

    7 téléchargements

    Je post ici cette include car elle n'est plus disponible sur le forum officiel. Voici le post original de : Emmet_ http://forum.sa-mp.com/showthread.php?t=475838 easyDialog.incIntroductionI've released this include a little over a year ago. However, it didn't have many features and it wasn't crash proof, so I've decided to scrap it and rewrite the whole include from scratch.PurposeThe purpose of this include is to make dialogs easier to use in general.Imagine having over 100 dialog checks under OnDialogResponse. It's just too messy and most of the time, it's unorganized and harder to look for certain dialogs for future editing, and remembering certain dialog ID's can be a pain in the ass. However, easyDialog.inc fixes that by introducing a "named dialog feature" which allows scripters to declare a dialog by name, rather than ID. Feature OnDialogResponse easyDialog.inc Crash Proof No Yes Named Dialogs No Yes Calling a dialog manually No Yes Custom callback for handling No Yes This code: Code: #define DIALOG_WEAPON (1337) CMD:weapons(playerid, params[]) { ShowPlayerDialog(playerid, DIALOG_WEAPON, DIALOG_STYLE_LIST, "Weapon Menu", "9mm\nSilenced 9mm\nDesert Eagle\nShotgun\nSawn-off Shotgun\nCombat Shotgun", "Select", "Cancel"); return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_WEAPON) { if (response) { new str[64]; format(str, 64, "You have selected the '%s'.", inputtext); GivePlayerWeapon(playerid, listitem + 22, 500); SendClientMessage(playerid, -1, str); } } return 1; } Turns into this code: Code: CMD:weapons(playerid, params[]) { Dialog_Show(playerid, WeaponMenu, DIALOG_STYLE_LIST, "Weapon Menu", "9mm\nSilenced 9mm\nDesert Eagle\nShotgun\nSawn-off Shotgun\nCombat Shotgun", "Select", "Cancel"); return 1; } Dialog:WeaponMenu(playerid, response, listitem, inputtext[]) { if (response) { new str[64]; format(str, 64, "You have selected the '%s'.", inputtext); GivePlayerWeapon(playerid, listitem + 22, 500); SendClientMessage(playerid, -1, str); } return 1; } I think the second example is much more neater, especially for larger scripts.CallbackThis script introduces a new callback: Code: public OnDialogPerformed(playerid, dialog[], response, success) { return 1; } This callback is called before a dialog is shown to a player (using Dialog_Show, that is). Returning 0 under this callback will prevent the dialog from working. Code: public OnDialogPerformed(playerid, dialog[], response, success) { if (!strcmp(dialog, "WeaponMenu") && IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, -1, "You must be on-foot to spawn a weapon."); return 0; } return 1; } Very simple, isn't it?FunctionsThis include introduces several new useful functions: Code: Dialog_Show(playerid, dialog, style, caption[], info[], button1[], button2[]); Shows a dialog to a player. Code: Dialog_Close(playerid); Closes any opened dialogs. Code: Dialog_Opened(playerid); Returns 1 if the dialog is opened for the specified player.DownloadeasyDialog.inc (Pastebin)easyDialog.inc (Solidfiles)Example Script (Pastebin)Example Script (Solidfiles)This include doesn't work...a) Update to the newest versioneasyDialog was originally released in 2012, and the latest stable version was released on March 31, 2015. You must update to the latest version for the latest features and bug fixes. Code: // easyDialog v1.0 Syntax: ShowDialog(playerid, Show:MyDialog, DIALOG_STYLE_LIST, "List", "Items", "Select", "Cancel"); // easyDialog v2.0 Syntax: Dialog_Show(playerid, MyDialog, DIALOG_STYLE_LIST, "List", "Items", "Select", "Cancel"); easyDialog works in parallel with OnDialogResponse, so you can use both at the same time. Older versions do not support this.b) Includes and filterscriptsReturning 0 under OnDialogResponse will pass the dialog to other scripts containing the callback. However, certain filterscripts and third-party libraries might return 1 instead. This interferes with the inner workings of easyDialog and causes the dialogs to not work.Simply return 0 instead to fix the issue.
  4. Nitram

    Mon premier site web

    nul
  5. Cherche : Scripteur, Développeur Web, Mappeur, Financeur Description/Présentation du projet : serveur RP sur los santos Moyen de contact : mp sur le forum
  6. Nitram

    Problème démarrage serveur SA:MP

    Problème lib32. Ton serveur est en 64 bits et SAMP tourne en 32 bits.
  7. Nitram

    Présentation de Electron. Step #1

    Oui, en ajoutant un module. C'est compliqué pour une démonstration du framework
  8. Nitram

    Présentation de Electron. Step #1

    Électron ne supporte pas ES6
  9. Nitram

    Votre Serveur Roleplay[Français][0.3.7-R2]

  10. Nitram

    Besoin d'aide Paypal

    Tu as rien d'affiché dans la console ? Essaye de remplacer ton petit morceau de php par : <?= isset($_SESSION['id']) $_SESSION['id']; ?>
  11. Nitram

    Mise à jour graphique

    Moi j’aime bien !
  12. Nitram

    Serveur SAMP MySQL

    excellent
×