Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // include
- #include <a_samp>
- #include <sscanf>
- #include <double-o-Files>
- #define FILTERSCRIPT
- #include <zcmd>
- // kolory
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_ADMIN 0xFF0000AA
- #define COLOR_RED 0xAA3333AA
- #define SCM SendClientMessage
- #pragma unused strtok
- #pragma unused ret_memcpy
- new Vip[MAX_PLAYERS];
- new Mute[MAX_PLAYERS];
- new UnMutex;
- new Warn[MAX_PLAYERS];
- new Text:Ann;
- stock PlayerName(playerid)
- {
- new name[124];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- stock PlayerIP(playerid)
- {
- new ajpi[16];
- GetPlayerIp(playerid, ajpi, sizeof(ajpi));
- return ajpi;
- }
- stock SendClientMessageToVip(color, msg[])
- {
- for(new a;a<GetMaxPlayers();a++)
- {
- if(IsPlayerConnected(a) && Vip[a])
- {
- SendClientMessage(a,color,msg);
- }
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" System Vipa by Skipper98");
- print("--------------------------------------\n");
- Ann = TextDrawCreate(319.000000, 326.000000," ");
- TextDrawUseBox(Ann, 1);
- TextDrawBoxColor(Ann, COLOR_WHITE);
- TextDrawTextSize(Ann, 32.000000,378.000000);
- TextDrawAlignment(Ann, 2);
- TextDrawBackgroundColor(Ann, 0x000000ff);
- TextDrawFont(Ann, 2);
- TextDrawLetterSize(Ann, 0.399999,1.000000);
- TextDrawColor(Ann, 0xffffffff);
- TextDrawSetShadow(Ann, 1);
- SetTimer("Cosie",500000,1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF_Exit();
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(Mute[playerid] == 1)
- {
- SendClientMessage(playerid,COLOR_YELLOW,"Nie możesz pisać zostałeś/aś uciszony.");
- return 0;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- Vip[playerid] = 0;
- Mute[playerid] = 0;
- Warn[playerid] = 0;
- return 1;
- }
- CMD:cmdvip(playerid,params[])
- {
- if(!Vip[playerid]) return SendClientMessage(playerid,COLOR_ADMIN,"Nie jesteś vipem !");
- new string[1024];
- strcat(string,"Komendy dla vipa:\n");
- strcat(string,"{FFFF00}/vkick [ID] [Powód] {FFFFFF}- Dajesz graczowi kicka\n");
- strcat(string,"{FFFF00}/vmute [ID] [Czas] {FFFFFF}- Uciszasz gracza\n");
- strcat(string,"{FFFF00}/vunmute [ID] {FFFFFF}- Odciszasz gracza\n");
- strcat(string,"{FFFF00}/vwarn [ID] [Powód] {FFFFFF}- Dajesz ostrzeżenie graczu\n");
- strcat(string,"{FFFF00}/vunwarn [ID] {FFFFFF}- Zdejmujesz graczu ostrzeżenie\n");
- strcat(string,"{FFFF00}/vgivemoney [ID] [Kasa] {FFFFFF}- Dajesz graczu kase\n");
- strcat(string,"{FFFF00}/vheal [ID] {FFFFFF}- Leczysz gracza\n");
- strcat(string,"{FFFF00}/varmor [ID] {FFFFFF}- Dajesz graczu pancerz\n");
- strcat(string,"{FFFF00}/vsay [Tekst] {FFFFFF}- Piszesz na chacie vip\n");
- strcat(string,"{FFFF00}/v [Tekst] {FFFFFF}- Rozmawiasz na chacie vipów\n");
- strcat(string,"{FFFF00}/vukryj {FFFFFF}- Robisz się niewidzialny na mapie\n");
- strcat(string,"{FFFF00}/vpokaz {FFFFFF}- Robisz się widoczny na mapie\n");
- strcat(string,"Koniec komend vipa.\n");
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"System vipa by skipper",string,"OK","OK");
- return 1;
- }
- CMD:viplogin(playerid,cmdtext[])
- {
- if(isnull(cmdtext)) return SendClientMessage(playerid,COLOR_WHITE,"/vlogin [Hasło]");
- if(Vip[playerid] == 1) return SendClientMessage(playerid,COLOR_ADMIN,"Już jesteś zalogowany na vipa.");
- new tmp[256];
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- tmp = DOF_GetString("Vip.ini",playername);
- new Log = strval(tmp);
- if(Log < 1)
- {
- SendClientMessage(playerid,COLOR_ADMIN,"Zostajesz wyrzucony z serwera powód: Wkradanie się do konta vipa.");
- Kick(playerid);
- }
- if(DOF_FileExists("Vip.ini"))
- {
- if(strcmp(cmdtext,DOF_GetString("Vip.ini","Haslo"),true)==0)
- {
- Vip[playerid] = 1;
- new string[124];
- format(string,sizeof(string),"Witaj %s.\nZalogowałeś się poprawnie jako vip.\nWszystkie Komendy Znajdziesz pod /cmdvip",PlayerName(playerid));
- ShowPlayerDialog(playerid,2,0,"Zalogowano !",string,"OK","OK");
- new printx[124];
- format(printx,sizeof(printx),"%s - Logowanie Vip",PlayerName(playerid));
- print(printx);
- }
- else
- {
- new xx[124];
- format(xx,sizeof(xx),"Hasło: %s jest niepoprawne !",cmdtext);
- ShowPlayerDialog(playerid,2,0,"Złe Hasło",xx,"OK","OK");
- }
- }
- else
- {
- DOF_CreateFile("Vip.ini");
- DOF_SetString("Vip.ini","Haslo","Haslo");
- new c = 1;
- DOF_SetInt("Vip.ini",PlayerName(playerid),c);
- }
- return 1;
- }
- CMD:viploguj(playerid,params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Nie jesteś Head Admin");
- new id = strval(params);
- if(id < 0 || id > GetMaxPlayers()) return SendClientMessage(playerid,-1,"Wpisz: /viploguj [ID]");
- if(!IsPlayerConnected(id)) return SCM(playerid,-1,"Nie ma takiego gracza.");
- new string[124];
- Vip[id] = 1;
- DOF_SetString("Vip.ini",PlayerName(id),"1");
- format(string,sizeof(string),"Head Admin %s (id: %d) Zalogował cię jako Vipa.",PlayerName(playerid),playerid);
- SendClientMessage(id,COLOR_YELLOW,string);
- format(string,sizeof(string),"Zalogowałeś i dodałeś Gracza %s Do listy Vipów.",PlayerName(id));
- SendClientMessage(playerid,COLOR_YELLOW,string);
- return 1;
- }
- CMD:viphaslo(playerid,cmdtext[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Nie jesteś Head Admin");
- if(isnull(cmdtext)) return SCM(playerid,-1,"Wpisz: /viphaslo [Hasło] ");
- DOF_SetString("Vip.ini","Haslo",cmdtext);
- new string[124];
- format(string,sizeof(string),"Ustawiłeś hasło Vipa na: %s",cmdtext);
- SendClientMessage(playerid,COLOR_ADMIN,string);
- return 1;
- }
- if(strcmp(cmdtext, "/v-visible", true) == 0) {
- if (VIP[playerid]){
- {
- SetPlayerColor(playerid, playerColors[playerid]);
- SendClientMessage(playerid, playerColors[playerid],"AS: Stałeś sie widzialny");
- format(string, sizeof(string), "Admin %s (id:%d) stal sie widzialny",PlayerName(playerid), playerid);
- printf(string);
- }
- }
- return 1;
- }
- if(strcmp(cmdtext, "/v-invisible", true)==0) {
- if (VIP[playerid]){
- SetPlayerColor(playerid, 0xFFFFFF00);
- SendClientMessage(playerid, COLOR_GREEN,"VIP: stałeś się niewidzialny");
- format(string, sizeof(string), "VIP %s (id:%d) zrobil sie niewidzialnym",PlayerName(playerid),playerid);
- printf(string);
- }
- return 1;
- }
- if (strcmp(cmd, "/v-givecash", true)==0 && VIP[playerid]) {
- new moneyplayer;
- new moneyplus;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, BIALY, "VS: /v-givecash [ID gracza] [suma]");
- } else {
- moneyplayer = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, CZERWONY, "AS: Zła waluta");
- } else {
- moneyplus = strval(tmp);
- new kasa_gracza = GetPlayerMoney(moneyplayer);
- if(moneyplus<=30000 && kasa_gracza <= 50000){
- new moneyplayername[MAX_PLAYER_NAME];
- GetPlayerName(moneyplayer,moneyplayername,sizeof(moneyplayername));
- format(string, sizeof(string), "VIP %s (id:%d) dal %d$ graczowi %s (id: %d)",PlayerName(playerid),playerid, moneyplus, moneyplayername,giveplayerid);
- printf(string);
- format(string, sizeof(string), "VS: Dałeś %d$ graczowi %s",moneyplus, moneyplayername);
- SendClientMessage(playerid, ZIELONY, string);
- format(string, sizeof(string), "VIP %s dał ci %d$",PlayerName(playerid),moneyplus);
- SendClientMessage(moneyplayer, ZIELONY, string);
- GivePlayerMoney(moneyplayer, moneyplus);
- }else{
- SendClientMessage(playerid, CZERWONY, "Możesz dać po 30000 Max!");
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/v-settime", true)==0 && VIP[playerid]) {
- new newtime;
- tmp = strtok(cmdtext, idx);
- newtime = strval(tmp);
- if(!newtime) {
- SendClientMessage(playerid, BIALY, "VS: /v-settime [godzina]");
- }
- else if (newtime >24 || newtime <0) {
- SendClientMessage(playerid, ZIELONY, "VS: Zła godzina.");
- }
- else {
- format(string, sizeof(string), "VIP %s (id:%d) zmienil czas na %d:00",PlayerName(playerid), playerid,newtime);
- printf(string);
- format(tmp, sizeof(tmp), "Czas został zmieniony na %d:00 przez VIPa %s", newtime, PlayerName(playerid));
- SendClientMessageToAll(ZIELONY,tmp);
- SetWorldTime(newtime);
- }
- return true;
- }
- if(strcmp(cmd, "/v-tp", true) == 0 && VIP[playerid]) {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, BIALY, "VS: /v-tp [ID 1 gracza] [do ID 2 gracza]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, BIALY, "VS: /v-tp [ID 1 gracza] [do ID 2 gracza]");
- return 1;
- }
- teleid = strval(tmp);
- if (IsPlayerConnected(giveplayerid) && IsPlayerConnected(teleid)) {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(teleid, telename, sizeof(telename));
- GetPlayerPos(teleid, pX,pY,pZ);
- new Interior;
- Interior = GetPlayerInterior(teleid);
- SetPlayerInterior(giveplayerid, Interior);
- SetPlayerPos(giveplayerid, pX,pY,pZ);
- format(string, sizeof(string), "VIP %s (id:%d) teleportowal %s (id: %d) do %s (id: %d)",PlayerName(playerid),playerid,giveplayer,giveplayerid,telename,teleid);
- printf(string);
- format(string, sizeof(string), "Teleportowałeś %s do %s", giveplayer,telename);
- SendClientMessage(playerid, ZIELONY, string);
- format(string, sizeof(string), "Zostałes teleportowany do %s",telename);
- SendClientMessage(giveplayerid, ZIELONY, string);
- format(string, sizeof(string), "Teleportowano do ciebie gracza: %s",giveplayer);
- SendClientMessage(teleid, ZIELONY, string);
- }
- if (!IsPlayerConnected(giveplayerid)) {
- format(string, sizeof(string), "VS: %d nie jest aktywnym graczem.", giveplayerid);
- SendClientMessage(playerid, CZERWONY, string);
- }
- if (!IsPlayerConnected(teleid)) {
- format(string, sizeof(string), "VS: %d nie jest aktywnym graczem.", teleid);
- SendClientMessage(playerid, CZERWONY, string);
- }
- return 1;
- }
- else if(strcmp(cmd, "/v-tp-to", true) == 0 && VIP[playerid]) {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, BIALY, "VS: /v-tp-to [id gracza]");
- } else {
- if(!IsPlayerConnected(strval(tmp))) {
- SendClientMessage(playerid, CZERWONY, "Złe ID gracza");
- } else {
- new Float:X;
- new Float:Y;
- new Float:Z;
- new Float:Angle;
- new Interior = GetPlayerInterior(strval(tmp));
- if(IsPlayerInAnyVehicle(playerid)) {
- new VehicleID;
- VehicleID = GetPlayerVehicleID(playerid);
- SetPlayerInterior(playerid, Interior);
- GetPlayerPos(strval(tmp),X,Y,Z);
- GetPlayerFacingAngle(strval(tmp),Angle);
- SetVehiclePos(VehicleID, X + 0.01, Y + 0.01, Z);
- SetPlayerFacingAngle(playerid,Angle);
- } else {
- GetPlayerPos(strval(tmp),X,Y,Z);
- SetPlayerInterior(playerid, Interior);
- GetPlayerFacingAngle(strval(tmp),Angle);
- SetPlayerFacingAngle(playerid,Angle);
- SetPlayerPos(playerid, X + 0.01, Y + 0.01, Z);
- }
- format(tempstr, sizeof(tempstr), "VIP %s teleportowal sie do ciebie",PlayerName(playerid));
- SendClientMessage(strval(tmp),ZIELONY, tempstr);
- format(tempstr, sizeof(tempstr), "VS: teleportowałeś się do %s Interior:%d",PlayerName(strval(tmp)), Interior);
- SendClientMessage(playerid,ZIELONY, tempstr);
- format(string, sizeof(string), "VIP %s (id:%d) teleportowal sie do gracza %s (id:%d) Interior:%d",PlayerName(playerid),playerid,GetPlayerNick(strval(tmp)),strval(tmp), Interior);
- printf(string);
- }
- }
- return 1;
- }if (strcmp(cmd, "/v-acolor", true)==0 && VIP[playerid]) {
- new colorplayer;
- new colorplayername[MAX_PLAYER_NAME];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid,BIALY, "VS: /v-acolor [ID gracza] [ID koloru]");
- } else {
- colorplayer = strval(tmp);
- }
- GetPlayerName(colorplayer,colorplayername,sizeof(colorplayername));
- tmp2 = strtok(cmdtext, idx);
- new color;
- color = strval(tmp2);
- if(color == 1){
- SetPlayerColor(colorplayer, COLOR_GREY);
- } else if(color == 2){
- SetPlayerColor(colorplayer, COLOR_LIGHTGREEN);
- } else if(color == 3){
- SetPlayerColor(colorplayer, COLOR_RED);
- } else if(color == 4){
- SetPlayerColor(colorplayer, COLOR_YELLOW);
- } else if(color == 5){
- SetPlayerColor(colorplayer, COLOR_WHITE);
- } else if(color == 6){
- SetPlayerColor(colorplayer, COLOR_BLUE);
- } else if(color == 7){
- SetPlayerColor(colorplayer, COLOR_ORANGE);
- } else if(color == 8){
- SetPlayerColor(colorplayer, COLOR_PINK);
- } else if(color == 9){
- SetPlayerColor(colorplayer, 0xFFFFFF00);
- } else if(color == 10){
- SetPlayerColor(colorplayer, COLOR_VIOLET);
- } else if(color == 11){
- SetPlayerColor(colorplayer, COLOR_BLACK);
- } else if(color == 12){
- SetPlayerColor(colorplayer, COLOR_BROWN);
- } else if(color == 13){
- SetPlayerColor(colorplayer, COLOR_LIGHTBLUE);
- } else if(color == 14){
- SetPlayerColor(colorplayer, COLOR_GREEN);
- } else if(color == 15){
- SetPlayerColor(colorplayer, COLOR_KREM);
- } else if(color == 16){
- SetPlayerColor(colorplayer, COLOR_ADMIN);
- } else {
- SendClientMessage(playerid, COLOR_ADMIN, "Zły ID koloru: ID (od 1 do 16)");
- }
- format(string, sizeof(string), "VS: Zmieniłeś kolor graczowi %s na: %d",PlayerName(strval(tmp)), color);
- SendClientMessage(playerid,ZIELONY,string);
- format(string, sizeof(string), "VIP %s zmienil ci kolor na: %d",PlayerName(playerid), color);
- SendClientMessage(strval(tmp),ZIELONY,string);
- format(string, sizeof(string), "VIP %s (id:%d) zmienil kolor (id:%d) graczowi %s (id:%d)",PlayerName(playerid), playerid, color, GetPlayerNick(strval(tmp)),strval(tmp));
- printf(string);
- return 1;
- }if(strcmp(cmdtext,"/v-repair-all",true)==0) {
- if (!VIP[playerid]) {
- SendClientMessage(playerid,0xAA3333AA,"Nie jestes VIP");
- return 1;
- }
- for(new i=0; i<MAX_PLAYERS; i++) {
- if (IsPlayerConnected(i)) {
- SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
- }
- }
- format(string, sizeof(string), "VIP %s (id:%d) naprawił pojazdy wszystkim graczom",PlayerName(playerid),playerid);
- printf(string);
- format(string, sizeof(string), "VIP %s naprawił pojazdy wszystkim graczom",PlayerName(playerid));
- SendClientMessageToAll(ZIELONY,string);
- return 1;
- }
- if(strcmp(cmd, "/v-repair", true) == 0 && VIP[playerid]) {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, BIALY, "VS: /v-repair [id gracza]");
- return 1;
- }
- giveplayerid = strval(tmp);
- if (IsPlayerConnected(giveplayerid)) {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SetVehicleHealth(GetPlayerVehicleID(giveplayerid), 1000.0);
- format(string, sizeof(string), "VIP %s (id:%d) naprawił pojazd graczowi %s (id: %d)",PlayerName(playerid),playerid,giveplayer,giveplayerid);
- printf(string);
- format(string, sizeof(string), "VS: Naprawiłeś pojazd graczowi %s.", giveplayer,giveplayerid);
- SendClientMessage(playerid, ZIELONY, string);
- format(string, sizeof(string), "VIP %s (id: %d) naprawił ci pojazd.", PlayerName(playerid),playerid);
- SendClientMessage(giveplayerid, ZIELONY, string);
- }
- else {
- format(string, sizeof(string), "VS: %d nie jest aktywnym graczem.", giveplayerid);
- SendClientMessage(playerid, CZERWONY, string);
- }
- return 1;
- }
- if(strcmp(cmdtext, "/v-armor", true)==0)
- {
- if (!VIP[playerid]) return SendClientMessage(playerid, CZERWONY,"Nie jestes VIPem!");
- SetPlayerArmour(playerid, 100.0);
- format(string, sizeof(string), "VIP %s (id:%d) dostal pancerz",PlayerName(playerid),playerid);
- printf(string);
- SendClientMessage(playerid, ZIELONY,"VS: Dostałeś pancerz!");
- return 1;
- }
- if(strcmp(cmdtext,"/v-armor-all",true)==0) {
- if (!VIP[playerid]) {
- SendClientMessage(playerid,CZERWONY,"Nie jestes VIPem!");
- return 1;
- }
- for(new i=0; i<MAX_PLAYERS; i++) {
- if (IsPlayerConnected(i)) {
- SetPlayerArmour(i,100.0);
- }
- }
- format(string, sizeof(string), "VIP %s (id:%d) dal pancerz wszystkim graczom",PlayerName(playerid),playerid);
- printf(string);
- format(string, sizeof(string), "VIP %s dal pancerz wszystkim graczom",PlayerName(playerid));
- SendClientMessageToAll(ZIELONY,string);
- return 1;
- }
- return 0;
- }
- PlayerName(playerid){
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- return Name;
- }
- GetPlayerNick(playerid){
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- return Name;
- }
- strrest(const string[], index)
- {
- new length = strlen(string),offset = index,result[256];
- while ((index < length) && ((index - offset) < (sizeof(result) - 1)) && (string[index] > '\r'))
- {
- result[index - offset] = string[index];index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- SendClientMessageToVIP(color, const zmienna[]) {
- for(new a=0; a<MAX_PLAYERS; a++) {
- if(IsPlayerConnected(a)) {
- if(VIP[a] || IsPlayerAdmin(a)) {
- SendClientMessage(a, color, zmienna);
- }
- }
- }
- }
- CMD:vsay(playerid,cmdtext[])
- {
- if(!Vip[playerid]) return SendClientMessage(playerid,COLOR_ADMIN,"Nie jesteś vipem !");
- if(isnull(cmdtext)) return SCM(playerid,-1,"Wpisz: /vsay [Tekst]");
- new string[124];
- format(string,sizeof(string),"Vip: %s",cmdtext);
- SendClientMessageToAll(COLOR_YELLOW,string);
- return 1;
- }
- public OnPlayerText(playerid, text)
- {
- new var0[256];
- if(globC8[playerid])
- {
- format(var0, 256, "%d (VIP) : %s", playerid, text);
- SendPlayerMessageToAll(playerid, var0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement