Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-----------------------All Includes-----------------------*/
- #include <a_samp>
- #include <zcmd>
- #include <dini>
- #include <sscanf>
- #include <dutils>
- #include <Dudb>
- /*-----------------------All Includes-----------------------*/
- /*-----------------------Save-----------------------*/
- #define savefolder "/Accounts/%s.ini"
- /*-----------------------Save-----------------------*/
- /*-----------------------PM-----------------------*/
- new PMEnabled=1;
- forward PMLog(string[]);
- public PMLog(string[])
- {
- new pm[128];
- format(pm, sizeof(pm), "%s\n", string);
- new File:hFile;
- hFile = fopen("/LOGS/pm.log", io_append);
- fwrite(hFile, pm);
- fclose(hFile);
- }
- /*-----------------------PM-----------------------*/
- /*-----------------------Short-----------------------*/
- #define SCM SendClientMessage
- #define SCMTA SendClientMessageToAll
- #define SPD ShowPlayerDialog
- /*-----------------------Short-----------------------*/
- /*-----------------------Colours-----------------------*/
- #define C_YELLOW 0xFFFF00FF
- #define C_RED 0xFF0000C8
- #define C_BLUE 0x0080FFC8
- #define C_GREY 0xCECECEFF
- #define C_WHITE "{FFFFFF}"
- #define C_GREEN "{00FF22}"
- #define C_LIGHTBLUE "{00CED1}"
- /*-----------------------Colours-----------------------*/
- /*-----------------------Configuration-----------------------*/
- #define joinsg (true)
- #define leavemsg (true)
- #define randmsg (true)
- #define randmsgtime (60)
- /*-----------------------Configuration-----------------------*/
- /*-----------------------Prevent Warnings-----------------------*/
- #pragma unused strtok
- #pragma unused ret_memcpy
- /*-----------------------Prevent Warnings-----------------------*/
- #if randmsg == true
- new RandMSGS;
- new RandomMessages[][] =
- {
- ">> This server using G_System [FS]! <<",
- ">> Use /rules to check server rules! <<",
- ">> Contact me at fb.com/mrzackysevenfold <<",
- ">> Visit our forum! www.forum.sa-mp.com <<"
- };
- #endif
- #if randmsg == true
- forward RandomClientMessage();
- #endif
- public OnFilterScriptInit()
- {
- #if randmsg == true
- RandMSGS = SetTimer("RandomClientMessage",randmsgtime*1000,true);
- #endif
- print("\n--------------------------------------");
- print("LOADING.......");
- print("G_System v1.0 Loaded!!!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- #if randmsg == true
- KillTimer(RandMSGS);
- #endif
- print("\n--------------------------------------");
- print("LOADING.......");
- print("G_System v1.0 Unloaded!!!");
- print("--------------------------------------\n");
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(IsPlayerAdmin(playerid))
- {
- new name[MAX_PLAYER_NAME];
- new string[218];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "Rcon Admin %s has connected!", name);
- SCMTA(C_YELLOW, string);
- }
- #if defined joinmsg == true
- new string[180];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has connected to the server.",pname);
- SCMTA(C_GREY, string);
- #endif
- SendClientMessage(playerid, C_YELLOW, "This server using G_System [FS]");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- #if defined leavemsg == true
- new string[180], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has left the server.",pname);
- SCMTA(C_GREY, string);
- #endif
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new string[128];
- format(string, sizeof(string), "You are entering %i.",vehicleid);
- SCM(playerid, C_RED, string);
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- new string[35];
- format(string, sizeof(string), "INFO: You are exiting vehicle %i", vehicleid);
- SCM(playerid, C_RED, string);
- new Float:health;
- health = GetVehicleHealth(vehicleid, health);
- if(health >= 400 && health < 500)
- {
- GivePlayerMoney(playerid, -250);
- SCM(playerid, C_RED, "You've paid 250$ for the car damage you made.");
- }
- else if(health >= 500 && health < 650)
- {
- GivePlayerMoney(playerid, -750);
- SCM(playerid, C_RED, "You've paid 750$ for the car damage you made.");
- }
- else if(health >= 650 && health < 800)
- {
- GivePlayerMoney(playerid, -1250);
- SCM(playerid, C_RED, "You've paid 1250$ for the car damage you made.");
- }
- else if(health >= 800)
- {
- GivePlayerMoney(playerid, -1500);
- SCM(playerid, C_RED, "You've paid 1500$ for the car damage you made.");
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- CMD:pm(playerid, params [ ] )
- {
- if(IsPlayerConnected(playerid))
- {
- new pID, Message[60],playername[MAX_PLAYER_NAME],targetName[MAX_PLAYER_NAME],string[128],string2[128];
- if(sscanf(params, "us[60]", pID, Message)) return SCM(playerid, C_RED, "USAGE: /pm [ID] [Message]");
- if(pID == INVALID_PLAYER_ID) return SCM(playerid, C_RED, "Invalid Player");
- if(PMEnabled == 0) return SCM(playerid, C_RED, "PM Is Disabled");
- GetPlayerName(pID, targetName, sizeof(targetName));
- GetPlayerName(playerid, playername, sizeof(playername));
- format(string, sizeof(string), "Private Message from %s: %s", playername, Message);
- format(string2, sizeof(string2), "Private Message sent to %s: %s", targetName, Message);
- SCM(playerid, C_YELLOW, string2);
- SCM(pID, C_YELLOW, string);
- PMLog(string2);
- PMLog(string);
- }
- return 1;
- }
- CMD:warn(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new id; new reason; new string[64];
- if(!sscanf(params, "us", id, reason))
- {
- new Name[MAX_PLAYER_NAME]; new PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "Administrator %s has warned %s for %s", Name, PlayerName, reason);
- SendClientMessageToAll(0xFFFFFFFF, string);
- return 1;
- }
- else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /warn [ID][Reason]");
- }
- else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not allowed to use this command.");
- }
- #if randmsg == true
- public RandomClientMessage()
- {
- new randommsg = random(sizeof(RandomMessages));
- SendClientMessageToAll( C_BLUE, RandomMessages[randommsg]);
- return 1;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement