Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <Dini>
- #define rouge 0xFF0000FF
- #define gris 0xC0C0C0FF
- #define orange 0xFF8000FF
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- #define DIALOG_AIDE_1 5
- #define DIALOG_AIDE_2 6
- #define save "/Comptes/%s.ini"
- enum pOptions
- {
- pMDP,
- pSkin,
- pAdmin,
- pModo,
- pMDC,
- };
- new pInfo[MAX_PLAYERS][pOptions];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Pre-Alpha v0.0.1");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- new path[100];
- format(path, sizeof(path), save, pName);
- if(fexist(path))
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Connection","Veuillez entrer votre mot de passe pour vous connecter.","Connexion","Quitter");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Enregistrement","Entrez un mot de passe afin de créer un compte.","S'enregistrer","Quitter");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- new path[100];
- format(path, sizeof(path), save, pName);
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- dini_Create(path);
- dini_IntSet(path, "MDP", strlen(inputtext));
- dini_IntSet(path, "Admin", 0);
- dini_IntSet(path, "Modo", 0);
- dini_IntSet(path, "MDC", 0);
- dini_IntSet(path, "Skin", 0);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX, "Succès !", "Vous vous êtes enregistré avec succès !Bon jeu.", "OK", "");
- }
- }
- case DIALOG_LOGIN:
- {
- new pw[300];
- pw = dini_Get(path, "MDP");
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(strcmp(inputtext, pw, true) == 0)
- {
- SetPlayerSkin(playerid, dini_Int(path, "Skin"));
- dini_IntSet(path, "Admin",pInfo[playerid][pAdmin]);
- dini_IntSet(path, "Modo",pInfo[playerid][pModo]);
- dini_IntSet(path, "MDC",pInfo[playerid][pMDC]);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX, "Succès !", "Vous vous êtes connecté avec succès !Bon jeu.", "OK", "");
- }
- else return Kick(playerid);
- return 1;
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- CMD:aide(playerid, params[])
- {
- if(pInfo[playerid][pAdmin] == 0 || pInfo[playerid][pMDC] == 0 || pInfo[playerid][pModo] == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_AIDE_1, DIALOG_STYLE_MSGBOX,"AIDE", "{FFFF00}Commandes générales :\n", "OK", "");
- }
- else if(pInfo[playerid][pAdmin] == 1 || pInfo[playerid][pModo] == 1)
- {
- ShowPlayerDialog(playerid, DIALOG_AIDE_2, DIALOG_STYLE_MSGBOX,"AIDE", "{FFFF00}Commandes générales :\n\n{FF0000}Commandes d'administrations:\n/setskin - /vspawn", "OK", "");
- }
- return 1;
- }
- CMD:setskin(playerid, params[])
- {
- new skinid;
- new player;
- if(!sscanf(params, "ii", player, skinid))
- {
- if(skinid > 299)
- {
- SendClientMessage(playerid, rouge, "Attention ! Skin id ne doivent pas dépasser 299. Sous peine de crash.");
- }
- else if(player == INVALID_PLAYER_ID)
- {
- SendClientMessage(playerid, gris, "USAGE: /setskin <ID> <IDSKIN>");
- }
- else SetPlayerSkin(playerid, skinid);
- }
- else SendClientMessage(playerid, gris, "USAGE: /setskin <ID> <IDSKIN>");
- return 1;
- }
- CMD:vspawn(playerid, params[])
- {
- new vid;
- new Float:X, Float:Y, Float:Z, Float:Rot;
- GetPlayerFacingAngle(playerid, Rot);
- GetPlayerPos(playerid, X,Y,Z);
- if(pInfo[playerid][pAdmin] == 1 || pInfo[playerid][pModo] == 1)
- {
- if(!sscanf(params,"i", vid))
- {
- CreateVehicle(vid, X,Y,Z,Rot,-1,-1, 60);
- SendClientMessage(playerid, gris, "Véhicule spawn.");
- }
- else SendClientMessage(playerid, gris,"USAGE:/vspawn <ID>");
- }
- else SendClientMessage(playerid, rouge, "Vous n'êtes pas Administrateur/Modérateur du serveur. Faites une demande aux admins.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement