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 <dini>
- #include <dudb>
- #pragma unused ret_memcpy
- #define COLOR_GRAD1 0xB4B5B7FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD3 0xCBCCCEFF
- #define COLOR_GRAD4 0xD8D8D8FF
- #define COLOR_GRAD5 0xE3E3E3FF
- #define COLOR_GRAD6 0xF0F0F0FF
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_DARKBLUE 0x2641FEAA
- #define COLOR_ALLDEPT 0xFF8282AA
- //=================================
- //Register System
- #define DIALOGREG 1060
- #define DIALOGLOGIN 1061
- enum pInfo{pCash, pLogged, pSkin};
- new Player[MAX_PLAYERS][pInfo];
- //=================================
- #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("Blank Script");
- AddPlayerClass(24,1958.3783,1343.1572,15.3746,0,0,0,0,0,0,0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- // SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- // SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- // SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- // TogglePlayerSpectating(playerid, true);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- new file[256];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(file, sizeof(file), "Utenti/%s", Name);
- if(!dini_Exists(file))
- ShowPlayerDialog(playerid, DIALOGREG, DIALOG_STYLE_PASSWORD, "You need to register", "Enter a password below to register a new account", "Done", "Exit");
- else
- ShowPlayerDialog(playerid, DIALOGLOGIN, DIALOG_STYLE_PASSWORD, "Welcome!", " Enter your password below to Log-In ", "Done", "Exit");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new Name[MAX_PLAYER_NAME];
- new file[256];
- if(!Player[playerid][pLogged]) return 1;
- GetPlayerName(playerid, Name, sizeof(Name));
- format(file, sizeof(file), "Utenti/%s", Name);
- dini_IntSet(file, "Money", GetPlayerMoney(playerid));
- Player[playerid][pLogged] = 0;
- 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("/suicide", cmdtext, true, 8) == 0)
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- if (strcmp("/money", cmdtext, true, 6) == 0)
- {
- GivePlayerMoney(playerid, 2398);
- return 1;
- }
- if(!strcmp(cmdtext, "/me", true, 3))
- {
- if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [Action]");
- new name[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(name, sizeof(name), "* %s %s", name, cmdtext[3]);
- SendClientMessageToAll(0xFFFF00AA, name);
- return 1;
- }
- if(!strcmp(cmdtext, "/do", true, 3))
- {
- if(!cmdtext[3]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /do [Action]");
- new name[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(name, sizeof(name), "* %s (( %s ))", cmdtext[4], name);
- SendClientMessageToAll(0xFFFF00AA, name);
- 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[])
- {
- if (dialogid == DIALOGREG)
- {
- new Name[MAX_PLAYER_NAME];
- new file[256];
- if(!response) return Kick(playerid);
- if(!strlen(inputtext)) return
- ShowPlayerDialog(playerid, DIALOGREG, DIALOG_STYLE_PASSWORD, "You need to register", "Enter a password below to register a new account", "Done", "Exit");
- GetPlayerName(playerid, Name, sizeof(Name));
- format(file, sizeof(file), "Utenti/%s", Name);
- dini_Create(file);
- dini_IntSet(file, "Money", 5000);
- dini_Set(file, "Password", inputtext);
- ShowPlayerDialog(playerid, DIALOGLOGIN, DIALOG_STYLE_PASSWORD, "Welcome!", " Enter your password below to Log-In ", "Done", "Exit");
- SetSpawnInfo(playerid, 0, 26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- if (dialogid == DIALOGLOGIN)
- {
- new Name[MAX_PLAYER_NAME];
- new file[256];
- if(!response) return Kick(playerid);
- GetPlayerName(playerid, Name, sizeof(Name));
- format(file, sizeof(file), "Utenti/%s", Name);
- new Pass[260];
- Pass = dini_Get(file, "Password");
- if(strcmp(Pass, inputtext, true) || !strlen(inputtext))
- {
- ShowPlayerDialog(playerid, DIALOGLOGIN, DIALOG_STYLE_PASSWORD, "Wrong Password!", "Enter your own password below to LogIn", "Done", "Exit");
- return 1;
- }
- GivePlayerMoney(playerid, dini_Int(file, "Money"));
- Player[playerid][pLogged] = 1;
- SetSpawnInfo(playerid, 0, 26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement