Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ------------Laptop System by Compton's_Eazy_E-------------
- */
- #include <a_samp>
- #include <dini>
- #include "../include/gl_common.inc"
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" PC portable by Darkdi4bl0");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" PC portable by Darkdi4bl0");
- print("--------------------------------------\n");
- return 1;
- }
- new InChat[MAX_PLAYERS];
- forward LapUsersMssg(color,const string[]);
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- new RandomMSG[][] =
- {
- "Tu est sur google! Que cherche tu?",
- "Page pornographique, firefox ne peut pas continuer!",
- "Cette page ne peut pas etre chargée.",
- "A été détecté sur cette page, des virus ou malware, firefox ne peut donc pas continuer!",
- "Tu est sur le site de SA:MP!",
- "Tu est sur un site de hacking! fait attention!",
- "Tu est sur Ebay! Fait attention au arnaque!",
- "Bienvenue sur LeBonCoin, dans qu'elle region veut tu effectuer ta recherche?",
- "Vous étes bien sur le site de Microsoft!",
- "Tu est arrivé sur Meetic.fr, fais de belle rencontre!",
- "Tu est sur Skyrock, gere ton blog, et ecoute la radio!",
- "Bienvenue sur Facebook!",
- "Tu est sur AMVAssurance.fr! Portege bien t'es vehicules!",
- "Bienvenue sur Amazon.fr, choisi ce qu'il te plait!",
- "Sur 2xMoinsChere c'est vraiment pas chère!",
- "Tu est sur le site de Norton, un mise a jour peut étre?",
- "Le site est fermée definitivement!",
- "Ce site est en maintenance!",
- "Site introuvable!",
- "Te voila sur Humour.com, mare toi bien!",
- "La connection a été reinitialiser ou le reseau 3G ne passe pas!"
- };
- public OnPlayerText(playerid, text[])
- {
- if(InChat[playerid] == 1)
- {
- new string[128];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new virus = dini_Int(string, "Virus");
- if(virus == 1)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Norton: Votre ordinateur est infecté par un virus!");
- return 0;
- }
- new strings[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(strings, sizeof(strings), "[MSN %s] dit: %s", name, text);
- LapUsersMssg(0xDEEE20FF, strings);
- new types[56];
- format(types, sizeof(types), "%s ecrit sur MSN", name);
- ProxDetector(20.0, playerid, types, 0xDEEE20FF,0xDEEE20FF,0xDEEE20FF,0xDEEE20FF,0xDEEE20FF);
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- new tmp[256];
- new gMessage[256];
- new Message[128];
- new iName[128];
- new pName[128];
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/an", true) == 0 || strcmp(cmd, "/annonce", true) == 0)
- {
- new string[128];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new virus = dini_Int(string, "Virus");
- if(virus == 1)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Norton: Votre ordinateur est infecté par un virus!");
- return 0;
- }
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new haslap = dini_Int(string, "Ordinateur");
- if(haslap == 1)
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, 0xDEEE20FF, "USAGE: /[an]nonce [TEXT]");
- return 1;
- }
- new pNames[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pNames, sizeof(pNames));
- format(string,sizeof(string), "[Annonce par %s]: %s",pNames, result);
- LapUsersMssg(0xDEEE20FF, result);
- new types[56];
- format(types, sizeof(types), "%s ecrit sur son PC", name);
- ProxDetector(20.0, playerid, types, 0xDEEE20FF,0xDEEE20FF,0xDEEE20FF,0xDEEE20FF,0xDEEE20FF);
- }
- return 1;
- }
- if(strcmp("/email", cmd, true) == 0)
- {
- tmp = strtok(cmdtext,idx);
- if(!strlen(tmp) || strlen(tmp) > 5) {
- SendClientMessage(playerid,0xDEEE20FF,"/email (id) (message)");
- return 1;
- }
- new id = strval(tmp);
- gMessage = strrest(cmdtext,idx);
- if(!strlen(gMessage)) {
- SendClientMessage(playerid,0xDEEE20FF,"/email (id) (message)");
- return 1;
- }
- if(playerid != id)
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new haslap = dini_Int(string, "Ordinateur");
- if(haslap == 1)
- {
- GetPlayerName(id,iName,sizeof(iName));
- GetPlayerName(playerid,pName,sizeof(pName));
- format(Message,sizeof(Message),"[Tu a reçu un mail!] %s(%d): %s",iName,id,gMessage);
- SendClientMessage(playerid,0xDEEE20FF,Message);
- format(Message,sizeof(Message),"[Mail envoyé!] %s(%d): %s",pName,playerid,gMessage);
- SendClientMessage(id,0xDEEE20FF,Message);
- }
- else
- {
- }
- }
- else
- {
- GetPlayerName(id,iName,sizeof(iName));
- GetPlayerName(playerid,pName,sizeof(pName));
- format(Message,sizeof(Message),"[Tu a un mail!] %s(%d): %s",iName,id,gMessage);
- SendClientMessage(playerid,0xDEEE20FF,Message);
- format(Message,sizeof(Message),"[Mail envoyé!] %s(%d): %s",pName,playerid,gMessage);
- SendClientMessage(id,0xDEEE20FF,Message);
- }
- return 1;
- }
- if (strcmp(cmd, "/aidepc", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]:Commande: /credit, /acheterpc, /vendrepc, /email, /seconnecter (a msn)");
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]:Commande: /sedeconnecter, /[an]nonce, /internet, /acheternorton");
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]:Commande: /lancernorton");
- return 1;
- }
- }
- if (strcmp(cmd, "/internet", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new virus = dini_Int(string, "Malware");
- if(virus == 1)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Norton: Votre PC est infecté par des malware!");
- return 0;
- }
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new haslap = dini_Int(string, "Ordinateur");
- if(haslap == 1)
- {
- new s[128];
- new loginname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
- format(s,sizeof(s),"Bienvenue sur Google %s t\nVous utilisez Mozilla Firefox\nInternet Explorer est fortement deconseillé\nNe telechargez pas trop!\nBonne navigation!",loginname);
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Barre d'adresse :",s,"Rechercher","Annuler");
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'a pas de Pc Portable!");
- }
- }
- }
- if (strcmp(cmd, "/lancernorton", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new hasanti = dini_Int(string, "AntiVirus");
- if(hasanti == 1)
- {
- SendClientMessage(playerid, 0xDEEE20FF, "[Windows 7]: Lancement du CD......");
- SendClientMessage(playerid, 0xDEEE20FF, "[Windows 7]: Norton Anti-Virus chargé..");
- SendClientMessage(playerid, 0xDEEE20FF, "[Windows 7]: Installation de l'antivirus...");
- SendClientMessage(playerid, 0xDEEE20FF, "[Norton Anti-Virus]: Lancement d'une analyse...");
- SendClientMessage(playerid, 0xDEEE20FF, "[Norton Anti-Virus]: Analyse en cours...");
- SendClientMessage(playerid, 0xDEEE20FF, "[Norton Anti-Virus]: Analyse terminée!");
- SendClientMessage(playerid, 0xDEEE20FF, "[Norton Anti-Virus]: Suppression des virus, malware et autre...");
- SendClientMessage(playerid, 0xDEEE20FF, "[Norton Anti-Virus]: Suppression terminé!");
- SendClientMessage(playerid, 0xDEEE20FF, "[Norton Anti-Virus]: Merci d'utiliser Norton Anti-Virus, A bientôt !");
- dini_IntSet(string, "Virus", 0);
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "[Windows 7]: Tu n'a pas Norton!");
- }
- }
- }
- if (strcmp(cmd, "/sedeconnecter", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new haslap = dini_Int(string, "Ordinateur");
- if(haslap == 1)
- {
- format(string, sizeof(string), "%s s'est deconnecté de msn.", name );
- SendClientMessage(playerid, 0xDEEE20FF, "[Windows Live]: Tu t'es deconnecté de msn! pour te reconnecter fais /seconnecter.");
- LapUsersMssg(0xDEEE20FF, string);
- InChat[playerid] = 0;
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'a pas de Pc Portable!");
- }
- }
- }
- if (strcmp(cmd, "/seconnecter", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new haslap = dini_Int(string, "Ordinateur");
- if(haslap == 1)
- {
- format(string, sizeof(string), "%s s'est connecté!!", name );
- SendClientMessage(playerid, 0xDEEE20FF, "[Windows Live]: Appuye sur F6 ou T pour parler sur Msn!");
- LapUsersMssg(0xDEEE20FF, string);
- InChat[playerid] = 1;
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'as pas de Pc Portable!");
- }
- }
- }
- if (strcmp(cmd, "/credit", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]: Pc Portable systeme modifié par Darkdi4bl0");
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]: Les marque utilisée sont :");
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]: Windows®, Norton®, MSN®.");
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]: Merci d'avoir consulté les credit!");
- SendClientMessage(playerid, 0xDEEE20FF, "[ Pc Portable ]: Si tu a besoin d'aide sur mon systeme : /aidepc");
- return 1;
- }
- }
- if (strcmp(cmd, "/acheternorton", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- if(GetPlayerMoney(playerid) >= 500)
- {
- if (PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53) || PlayerToPoint(100, playerid, -22.1740,-138.6172,1003.5469))//centerpoint 24-7
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- GivePlayerMoney(playerid, -5500);
- dini_IntSet(string, "AntiVirus", 1);
- SendClientMessage(playerid, 0xDEEE20FF, "Tu a acheter un anti-virus: Norton!");
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'est pas dans un 24/7");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu a payer norton 500$");
- }
- }
- }
- if (strcmp(cmd, "/acheterpc", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- if(GetPlayerMoney(playerid) >= 3500)
- {
- if (PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53) || PlayerToPoint(100, playerid, -22.1740,-138.6172,1003.5469))//centerpoint 24-7
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- printf("%s a acheté un nouveau PC!", name);
- format(string, sizeof(string), "%s.ini", name );
- dini_IntSet(string, "Ordinateur", 1);
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: Voila c'est un magnifique ordinateur!");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: Le processeur est un Intel Core 2 Duo E7500 de 2.5GHz");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: Le disque dur a une capacité de 320Go et la memoire est de 3Go");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: La memoire graphique est de 512Mo dedié, il a la Wi-Fi, le bluetooth");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: Et j'oubliais, il tourne sous Windows 7 Ultimate!");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: c'est un très bon achat, Amusez vous bien!");
- SendClientMessage(playerid, 0xDEEE20FF, "Tu a acheté ton nouvel ordinateur portable!");
- SendClientMessage(playerid, 0xDEEE20FF, "Il est tout beau, tout neuf! La classe!");
- SendClientMessage(playerid, 0xDEEE20FF, "Tape /aidepc pour lire la notice en ligne!");
- GivePlayerMoney(playerid, -3500);//Prix d'achat du pc (ne pas enlever le -)
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'est pas dans un 24/7");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu a payé ton Ordinateur 3500$!");
- }
- }
- }
- if (strcmp(cmd, "/vendrepc", true) ==0 )
- {
- if(IsPlayerConnected(playerid))
- {
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- new haslap = dini_Int(string, "Ordinateur");
- if(haslap == 1)
- {
- if (PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53) || PlayerToPoint(100, playerid, -22.1740,-138.6172,1003.5469))//centerpoint 24-7
- {
- printf("%s a vendu son ordinateur!", name);
- dini_IntSet(string, "Ordinateur", 0);
- SendClientMessage(playerid, 0xDEEE20FF, "Tu a vendu ton ordinateur.");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: Tu me le ramène? Il te plait pas?");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: Enfin bref c'est ton choix !");
- SendClientMessage(playerid, 0xDEEE20FF, "Vendeur: je te le reprend 1500$.");
- GivePlayerMoney(playerid, 1500);// Prix de vente du PC
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'est pas dans un 24/7.");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xDEEE20FF, "Tu n'a pas de Pc portable!");
- }
- }
- }
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- new string[50];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- if(!dini_Exists(string))
- {
- dini_Create(string);
- dini_Set(string, "Ordinateur", "0");
- dini_IntSet(string, "Virus", 0);
- printf("%s ouvre son ordinateur.", name);
- }
- else
- {
- dini_Get(string, "Ordinateur");
- dini_Get(string, "Virus");
- printf("%s a chargé son compte d'utilisateur", name);
- }
- return 1;
- }
- public LapUsersMssg(color,const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new name[MAX_PLAYER_NAME];
- new strings[56];
- GetPlayerName(i, name, sizeof(name));
- format(strings, sizeof(strings), "%s.ini", name );
- new haslap = dini_Int(strings, "Ordinateur");
- if(haslap == 1 && InChat == 1)
- {
- SendClientMessage(i, color, string);
- PlayerPlaySound(i,1085,0.0,0.0,0.0);
- }
- }
- }
- return 1;
- }
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- //radi = 2.0; //Trigger Radius
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col1, string);
- }
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col2, string);
- }
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col3, string);
- }
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col4, string);
- }
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }//not connected
- return 1;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(!response) SendClientMessage(playerid, 0xFFFFFFFF, "Vous quittez!");
- new message[196];
- format(message, sizeof(message), "Mozilla Firefox - Chargement %s........", inputtext);
- SendClientMessage(playerid, 0xFFFFFFFF, message);
- new randMSG = random(sizeof(RandomMSG));
- SendClientMessage(playerid, 0xFFFFFFFF, RandomMSG[randMSG]);
- new Rand = random(1);
- new name[MAX_PLAYER_NAME];
- new string[56];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s.ini", name );
- dini_IntSet(string, "Virus", Rand);
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement