Advertisement
Dayrion

aezaefsdf SOIFI

May 16th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 25.40 KB | None | 0 0
  1. /* afaclead - IN WORKING*/
  2. CMD:afaclead(playerid, params[])
  3. {
  4.     if(U_Stats[playerid][pLevel] < 12) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You're not high admin enough.");
  5.     new target, facid;
  6.     if(sscanf(params,"ii", target, facid))
  7.     {
  8.         SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /afaclead [playerid] [faction_id]");
  9.         return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] ID 1 : LSPD | ID : 2 SFPD | ID : 3 Fox5");
  10.     }
  11.     if(facid < 1 || facid > 3) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] Invalid Faction ID");
  12.     if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] The player is offline.");
  13.     facid--;
  14.     print("smth");
  15.     if(U_Stats[target][pFaction] != -1 && strcmp(Factions[U_Stats[target][pFaction]-1][fLeader], GetName(playerid)) || U_Stats[target][pFaction] == -1)
  16.     {
  17.         U_Stats[target][pFaction] = facid+1;
  18.         print("ssmth");
  19.         new INI:File = INI_Open(UserPath(target));
  20.         INI_SetTag(File, "data");
  21.         INI_WriteString(File, "Rank", rankFac[facid][Factions[facid][fMaxRank]][0]);
  22.         INI_WriteInt(File, "Faction", U_Stats[target][pFaction]);
  23.         INI_Close(File);
  24.         INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
  25.  
  26.         new INI:file = INI_Open(FactionPath(facid));
  27.         INI_SetTag(file, "data");
  28.         INI_WriteString(file,"Leader",GetName(playerid));
  29.         INI_Close(file);
  30.         INI_ParseFile(FactionPath(facid), "LoadFaction_data", .bExtra = true, .extra = facid);
  31.  
  32.         facid++;
  33.         switch(facid)
  34.         {
  35.             case 1:
  36.             {
  37.                 new message[255];
  38.                 format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Police Department.", GetName(playerid), GetName(target));
  39.                 SendClientMessageToAll(-1, message);
  40.             }
  41.             case 2:
  42.             {
  43.                 new message[255];
  44.                 format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Fire and Medicial Department.", GetName(playerid), GetName(target));
  45.                 SendClientMessageToAll(-1, message);
  46.             }
  47.             case 3:
  48.             {
  49.                 new message[255];
  50.                 format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of FOX5 News.", GetName(playerid), GetName(target));
  51.                 SendClientMessageToAll(-1, message);
  52.             }
  53.             default: printf("[Error] ERROR MAKELEADER [1] | Player %s (ID:%i) | Admin %s (ID:%i)", GetName(target), target, GetName(playerid), playerid);
  54.         }
  55.         return 1;
  56.     }
  57.     else if(U_Stats[target][pFaction] != -1 && !strcmp(Factions[U_Stats[target][pFaction]-1][fLeader], GetName(playerid)))
  58.     {
  59.         new INI:file = INI_Open(FactionPath(U_Stats[target][pFaction]));
  60.         INI_SetTag(file, "data");
  61.         INI_WriteString(file,"Leader","None");
  62.         INI_Close(file);
  63.         INI_ParseFile(FactionPath(U_Stats[target][pFaction]), "LoadFaction_data", .bExtra = true, .extra = U_Stats[target][pFaction]);
  64.  
  65.         U_Stats[target][pFaction] = facid+1;
  66.         new INI:File = INI_Open(UserPath(target));
  67.         INI_SetTag(File, "data");
  68.         INI_WriteString(File, "Rank", rankFac[facid][Factions[facid][fMaxRank]][0]);
  69.         INI_WriteInt(File, "Faction", U_Stats[target][pFaction]);
  70.         INI_Close(File);
  71.         INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
  72.  
  73.         new INI:ffile = INI_Open(FactionPath(facid));
  74.         INI_SetTag(ffile, "data");
  75.         INI_WriteString(ffile,"Leader",GetName(playerid));
  76.         INI_Close(ffile);
  77.         INI_ParseFile(FactionPath(facid), "LoadFaction_data", .bExtra = true, .extra = facid);
  78.  
  79.         facid++;
  80.         switch(facid)
  81.         {
  82.             case 1:
  83.             {
  84.                 new message[255];
  85.                 format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Police Department.", GetName(playerid), GetName(target));
  86.                 SendClientMessageToAll(-1, message);
  87.             }
  88.             case 2:
  89.             {
  90.                 new message[255];
  91.                 format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Fire and Medicial Department.", GetName(playerid), GetName(target));
  92.                 SendClientMessageToAll(-1, message);
  93.             }
  94.             case 3:
  95.             {
  96.                 new message[255];
  97.                 format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of FOX5 News.", GetName(playerid), GetName(target));
  98.                 SendClientMessageToAll(-1, message);
  99.             }
  100.             default: printf("[Error] ERROR MAKELEADER [2] | Player %s (ID:%i) | Admin %s (ID:%i)", GetName(target), target, GetName(playerid), playerid);
  101.         }
  102.         return 1;
  103.     }
  104.     else
  105.     {
  106.         printf("[Error] ERROR MAKELEADER 3 | Player %s (ID:%i) | Admin %s (ID:%i)", GetName(target), target, GetName(playerid), playerid);
  107.         return 1;
  108.     }
  109. }
  110.  
  111. //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  112.  
  113.  
  114. CMD:invit(playerid, params[])
  115. {
  116.     new target;
  117.     if(strcmp(GetName(playerid), Factions[U_Stats[playerid][pFaction]][fLeader])) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need to be the leader of the faction");
  118.     if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /invit [player_id]");
  119.     if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not connected");
  120.     if(U_Stats[target][pFaction] != -1) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is in a faction.");
  121.  
  122.     new INI:File = INI_Open(UserPath(target));
  123.     INI_SetTag(File, "data");
  124.     INI_WriteString(File, "Rank", rankFac[U_Stats[playerid][pFaction]][0][0]);
  125.     INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
  126.     INI_Close(File);
  127.     INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
  128.  
  129.     new str[200];
  130.     format(str, sizeof(str), "{82CAFF}ยป %s %s has invited %s in the faction!", U_Stats[playerid][pRank], GetName(playerid), GetName(target));
  131.     FacRadio(playerid, str);
  132.  
  133.     return 1;
  134. }
  135.  
  136.  
  137. //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  138.  
  139. CMD:fire(playerid, params[])
  140. {
  141.     new target;
  142.     if(strcmp(GetName(playerid), Factions[U_Stats[playerid][pFaction]][fLeader]) || U_Stats[playerid][pLevel] < 12) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need to be the leader of the faction");
  143.     if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /fire [player_id]");
  144.     if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not connected");
  145.     if(U_Stats[target][pFaction] == -1 || U_Stats[target][pFaction] != U_Stats[playerid][pFaction]) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not in your faction.");
  146.  
  147.     if(!strcmp(Factions[U_Stats[target][pFaction]][fLeader], GetName(playerid)))
  148.     {
  149.         new INI:file = INI_Open(FactionPath(U_Stats[target][pFaction]));
  150.         INI_SetTag(file, "data");
  151.         INI_WriteString(file,"Leader","None");
  152.         INI_Close(file);
  153.         INI_ParseFile(FactionPath(U_Stats[target][pFaction]), "LoadFaction_data", .bExtra = true, .extra = U_Stats[target][pFaction]);
  154.  
  155.         new INI:File = INI_Open(UserPath(target));
  156.         INI_SetTag(File, "data");
  157.         INI_WriteString(File, "Rank", "None");
  158.         INI_WriteInt(File, "Faction", -1);
  159.         INI_Close(File);
  160.         INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
  161.         SetPlayerArmour(playerid, 0.0);
  162.         ResetPlayerWeapons(playerid);
  163.     }
  164.     else
  165.     {
  166.         new INI:File = INI_Open(UserPath(target));
  167.         INI_SetTag(File, "data");
  168.         INI_WriteString(File, "Rank", "None");
  169.         INI_WriteInt(File, "Faction", -1);
  170.         INI_Close(File);
  171.         INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
  172.  
  173.         SetPlayerArmour(playerid, 0.0);
  174.         ResetPlayerWeapons(playerid);
  175.     }
  176.  
  177.     new str[200];
  178.     format(str, sizeof(str), "{82CAFF}ยป %s %s has fired %s", U_Stats[playerid][pRank], GetName(playerid), GetName(target));
  179.     FacRadio(playerid, str);
  180.  
  181.     return 1;
  182. }
  183. //------------------------------------------------------------------------------------------------
  184. // ==============================================================================================
  185. //                            Los Angeles Police Department | Commands
  186. // ==============================================================================================
  187. //------------------------------------------------------------------------------------------------
  188.  
  189. new IsSuspect[MAX_PLAYERS];
  190. new IsPrisonnier[MAX_PLAYERS];
  191.  
  192. CMD:duty(playerid,params[])
  193. {
  194.     if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
  195.     //if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You must be at the comico'");
  196.     if(IsOnDuty[playerid] == false)
  197.     {
  198.         new str[128];
  199.         IsOnDuty[playerid] = true;
  200.         SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are now on duty");
  201.         format(str, sizeof(str), "* %s take his badge, weapon and radio.", GetName(playerid));
  202.         ProxDetector(15, playerid, str, 0xCC56CCFF);
  203.         SetPlayerArmour(playerid, 100.0);
  204.         GivePlayerWeapon(playerid, WEAPON_DEAGLE, 100);
  205.         GivePlayerWeapon(playerid, WEAPON_NITESTICK, 1);
  206.         GivePlayerWeapon(playerid, WEAPON_SPRAYCAN, 1000);
  207.         return 1;
  208.     }
  209.     else
  210.     {
  211.         new str[128];
  212.         IsOnDuty[playerid] = false;
  213.         SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are no longer on duty");
  214.         format(str, sizeof(str), "* %s put his badge, weapon, radio into his locker.", GetName(playerid));
  215.         ProxDetector(15, playerid, str, 0xCC56CCFF);
  216.         SetPlayerArmour(playerid, 0.0);
  217.         ResetPlayerWeapons(playerid);
  218.         return 1;
  219.     }
  220. }
  221.  
  222.  
  223. //------------------------------------------------------------------------------------------------
  224.  
  225. CMD:m(playerid, params[])
  226. {
  227.     if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
  228.     if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
  229.     if(U_Stats[playerid][pFaction] != 1 && U_Stats[playerid][pFaction] != 2) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You aren't allowed to use this command");
  230.     new text[150];
  231.     if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /m [Message]");
  232.     format(text, sizeof(text), "{ff0000}((%s | %s)) {FFFFFF}%s", GetName(playerid), Factions[U_Stats[playerid][pFaction]-1][fShortName], text);
  233.     ProxDetector(30, playerid, text, -1);
  234.     return 1;
  235. }
  236.  
  237.  
  238. //------------------------------------------------------------------------------------------------
  239.  
  240. CMD:r(playerid, params[])
  241. {
  242.     if(U_Stats[playerid][pFaction] == -1) return 1;
  243.     new text[150];
  244.     if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /r [Message]");
  245.     format(text, sizeof(text), "{1E90FF}(Radio) %s %s says: %s", U_Stats[playerid][pRank], GetName(playerid), text);
  246.     FacRadio(playerid, text);
  247.     return 1;
  248. }
  249.  
  250. //------------------------------------------------------------------------------------------------
  251.  
  252. CMD:d(playerid, params[])
  253. {
  254.     if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
  255.     if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
  256.     new text[150];
  257.     if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /d (regional) [Message]");
  258.     format(text, sizeof(text), "{B4BA00}(%s) %s %s : %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], U_Stats[playerid][pRank], GetName(playerid), text);
  259.     DepRadio(playerid, text);
  260.     return 1;
  261. }
  262.  
  263. //------------------------------------------------------------------------------------------------
  264.  
  265. CMD:su(playerid, params[])
  266. {
  267.     if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
  268.     if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
  269.     new target, reason[111];
  270.     if(sscanf(params, "is[110]", target, reason)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /su(uspect) [target_id] [reason]");
  271.     new str[120];
  272.     format(str, sizeof(str), "[{82CAFF}SUSPECT{FFFFFF}] %s | %s %s make %s suspect | Reason : %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], U_Stats[playerid][pRank], GetName(playerid), GetName(target), reason);
  273.     IsSuspect[target] = 1;
  274.     DepRadio(playerid, str);
  275.     return 1;
  276. }
  277.  
  278. //------------------------------------------------------------------------------------------------
  279.  
  280. CMD:arrest(playerid, params[])
  281. {
  282.     if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
  283.     if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
  284.     new Float:x, Float:y, Float:z, target, time, fine;
  285.     if(sscanf(params, "iii", target, time, fine)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /arrest [target_id] [time] [fine]");
  286.     if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] Wrong player ID");
  287.     if(IsSuspect[target] != 1) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not suspect!");
  288.     GetPlayerPos(playerid, x, y, z);
  289.     if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1572.7869, -1624.7345, 13.0293)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You're too far away from the arrest point.");
  290.     if(!IsPlayerInRangeOfPoint(target, 5.0, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] The suspect need to be near you!");
  291.     time = time * 60 * 1000;
  292.     SetPlayerPos(target, x, y, z);
  293.     SetTimerEx("FreePrisoniers", time, false, "ii", target, time);
  294.     new str[150];
  295.     format(str, sizeof(str), "[{82CAFF}%s{FFFFFF} Policier %s has arrested %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], GetName(playerid), GetName(target));
  296.     SendClientMessageToAll(-1, str);
  297.     //SetPlayerPos(target, x, y, z);
  298.     IsPrisonnier[target] = 1;
  299.     return 1;
  300. }
  301.  
  302.  
  303. forward FreePrisoniers(suspect, time);
  304. public FreePrisoniers(suspect, time)
  305. {
  306.     SetPlayerPos(suspect,1544.2457,-1675.5072,13.5580);
  307.     IsSuspect[suspect] = 0;
  308.     IsPrisonnier[suspect] = 0;
  309.     SendClientMessage(suspect, -1, "[{82CAFF}Prison{FFFFFF}]You are now free.");
  310.     new str[150];
  311.     time = time / 60 / 1000;
  312.     format(str, sizeof(str), "{82CAFF}ยป %s has been released from the prison after %i min(s)", GetName(suspect), time);
  313.     DepRadio(-1, str);
  314.     return 1;
  315. }
  316.  
  317. //------------------------------------------------------------------------------------------------------------------------------------------------------------
  318.  
  319. CMD:cuff(playerid, params[]) //Uses toggle version, So one cuff=cuffed, two cuff=uncuffed.
  320. {
  321.     if(U_Stats[playerid][pFaction] == 0)
  322.     {
  323.         new target;
  324.         if(sscanf(params, "i", target))
  325.         {
  326.             SendClientMessage(playerid, -1, COLOR_White_a"["COLOR_LightBlue_a"Error Usage"COLOR_White_a"] /cuff [playerid]");
  327.         }
  328.         else
  329.         {
  330.             if(!IsPlayerConnected(target))
  331.             {
  332.                 SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] That player is offline!");
  333.             }
  334.             else
  335.             {
  336.                 new Float:x, Float:y, Float:z;
  337.                 GetPlayerPos(target, x, y, z);
  338.                 if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
  339.                 {
  340.                     if(cuffed[target] == 0)
  341.                     {
  342.                         new str[128];
  343.                         format(str, sizeof(str), "** %s grabs a pair of cuffs and slaps them onto %s's wrists.", GetRPName(playerid), GetRPName(target));
  344.                         ProxDetector(15, playerid, str, COLOR_Purple);
  345.                         SetPlayerAttachedObject(target, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
  346.                         SetPlayerSpecialAction(target, SPECIAL_ACTION_CUFFED);
  347.                         cuffed[target] = 1;
  348.                     }
  349.                     else
  350.                     {
  351.                         new str[128];
  352.                         format(str, sizeof(str), "** %s grabs a pair of cuffs keys and unlocks %s's wrists.", GetRPName(playerid), GetRPName(target));
  353.                         ProxDetector(15, playerid, str, COLOR_Purple);
  354.                         SetPlayerSpecialAction(target,SPECIAL_ACTION_NONE);
  355.                         RemovePlayerAttachedObject(target, 1);
  356.                         cuffed[target] = 0;
  357.                     }
  358.                 }
  359.                 else
  360.                 {
  361.                     SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] You're too far away.");
  362.                 }
  363.             }
  364.         }
  365.     }
  366.     else
  367.     {
  368.         SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] You're not a Law Enforcement Officer.");
  369.     }
  370.     return 1;
  371. }
  372.  
  373. new tazer[MAX_PLAYERS] = 0,
  374.     storedDeagle[MAX_PLAYERS] = 0;
  375. CMD:tazer(playerid, params[])
  376. {
  377.     if(U_Stats[playerid][pFaction] == 0)
  378.     {
  379.         if(tazer[playerid] == 0)
  380.         {
  381.             if(GetPlayerWeapon(playerid) == 24)
  382.             {
  383.                 storedDeagle[playerid] = 1;
  384.                 tazer[playerid] = 1;
  385.                 GivePlayerWeapon(playerid, 23, 999999);
  386.             }
  387.             else
  388.             {
  389.                 storedDeagle[playerid] = 0;
  390.                 tazer[playerid] = 1;
  391.                 GivePlayerWeapon(playerid, 23, 999999);
  392.             }
  393.             new str[128];
  394.             format(str, sizeof(str), "** %s unbuckles their Tazer Holster and grabs their Tazer.", GetRPName(playerid));
  395.             ProxDetector(15, playerid, str, COLOR_Purple);
  396.         }
  397.         else
  398.         {
  399.             if(storedDeagle[playerid] == 1)
  400.             {
  401.                 storedDeagle[playerid] = 0;
  402.                 tazer[playerid] = 0;
  403.                 GivePlayerWeapon(playerid, 24, 999999);
  404.             }
  405.             else
  406.             {
  407.                 storedDeagle[playerid] = 0;
  408.                 tazer[playerid] = 0;
  409.                 SetPlayerAmmo(playerid, WEAPON_SILENCED, 0);
  410.             }
  411.             new str[128];
  412.             format(str, sizeof(str), "** %s buckles their Tazer Holster and with the Tazer in.", GetRPName(playerid));
  413.             ProxDetector(15, playerid, str, COLOR_Purple);
  414.         }
  415.     }
  416.     else
  417.     {
  418.         SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] You're not a Law Enforcement Officer.");
  419.     }
  420.     return 1;
  421. }
  422. stock DepRadio(playerid, string[])
  423. {
  424.     if(!LawE(playerid) && playerid != -1) return 1;
  425.     if(IsPrisonnier[playerid] == 1) return 1;
  426.     new text[150];
  427.     foreach(new i : Player)
  428.     {
  429.         if(!LawE(playerid)) continue;
  430.         format(text, sizeof(text), "%s", string);
  431.         SendClientMessage(i, -1, text);
  432.     }
  433.     return 1;
  434. }
  435.  
  436. stock FacRadio(playerid, string[])
  437. {
  438.     if(IsPrisonnier[playerid] == 1) return 1;
  439.     new text[150];
  440.     foreach(new i : Player)
  441.     {
  442.         if(U_Stats[playerid][pFaction] != U_Stats[i][pFaction]) continue;
  443.         format(text, sizeof(text), "%s", string);
  444.         SendClientMessage(i, -1, text);
  445.     }
  446.     return 1;
  447. }
  448.  
  449. /*- Start of: Vars -*/
  450. enum pStats
  451. {
  452.     pID,
  453.     pPassword[128],
  454.     pMail[128],
  455.     pAge,
  456.     pOrigin[128],
  457.     pGender[128],
  458.     pSkin,
  459.     pInterior,
  460.     pVW,
  461.     Float:pPositionX,
  462.     Float:pPositionY,
  463.     Float:pPositionZ,
  464.     pMoney,
  465.     pLevel,
  466.     pJob1,
  467.     pJob2,
  468.     pFlags,
  469.     pBanned,
  470.     pBanBy[128],
  471.     pBanReason[128],
  472.     pRegIP[128],
  473.     pLastIP[128],
  474.     pFaction,
  475.     pRank[11],
  476.     pHealthCare,
  477.     pPrisonnier,
  478.     pPrisonTime
  479. }
  480.  
  481. forward LoadUser_data(playerid,name[],value[]);
  482. public LoadUser_data(playerid,name[],value[])
  483. {
  484.     INI_Int("ID", U_Stats[playerid][pID]);
  485.     INI_String("Password", U_Stats[playerid][pPassword], 128);
  486.     INI_String("Mail", U_Stats[playerid][pMail], 128);
  487.     INI_Int("Age", U_Stats[playerid][pAge]);
  488.     INI_String("Origin", U_Stats[playerid][pOrigin], 128);
  489.     INI_String("Gender", U_Stats[playerid][pGender], 128);
  490.     INI_Int("Skin", U_Stats[playerid][pSkin]);
  491.     INI_Int("Interior", U_Stats[playerid][pInterior]);
  492.     INI_Int("VW", U_Stats[playerid][pVW]);
  493.     INI_Float("PositionX", U_Stats[playerid][pPositionX]);
  494.     INI_Float("PositionY", U_Stats[playerid][pPositionY]);
  495.     INI_Float("PositionZ", U_Stats[playerid][pPositionZ]);
  496.     INI_Int("Money", U_Stats[playerid][pMoney]);
  497.     INI_Int("Level", U_Stats[playerid][pLevel]);
  498.     INI_Int("Job1", U_Stats[playerid][pJob1]);
  499.     INI_Int("Job2", U_Stats[playerid][pJob2]);
  500.     INI_Int("Flags", U_Stats[playerid][pFlags]);
  501.     INI_Int("Banned", U_Stats[playerid][pBanned]);
  502.     INI_String("BanBy", U_Stats[playerid][pBanBy], 128);
  503.     INI_String("BanReason", U_Stats[playerid][pBanReason], 128);
  504.     INI_String("RegIP", U_Stats[playerid][pRegIP], 128);
  505.     INI_String("LastIP", U_Stats[playerid][pLastIP], 128);
  506.     INI_Int("Faction", U_Stats[playerid][pFaction]);
  507.     INI_String("Rank", U_Stats[playerid][pRank], 11);
  508.     INI_Int("HealthCare", U_Stats[playerid][pHealthCare]);
  509.     INI_Int("Prisonnier", U_Stats[playerid][pPrisonnier]);
  510.     INI_Int("PrisonTime", U_Stats[playerid][pPrisonTime]);
  511.     return 1;
  512. }
  513.                         SpawnPlayer(playerid);
  514.                         SetSpawnInfo( playerid, 0, U_Stats[playerid][pSkin], U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ], 269.15, 0, 0, 0, 0, 0, 0 );
  515.                         TogglePlayerSpectating(playerid, 0);
  516.                         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  517.                         SpawnPlayer(playerid);
  518.                         SetPlayerSkin(playerid, U_Stats[playerid][pSkin]);
  519.                         SetPlayerInterior(playerid, U_Stats[playerid][pInterior]);
  520.                         SetPlayerVirtualWorld(playerid, U_Stats[playerid][pVW]);
  521.                         SetPlayerPos(playerid, U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ]);
  522.                         GivePlayerMoney(playerid, U_Stats[playerid][pMoney]);
  523.                         SetPlayerScore(playerid, U_Stats[playerid][pLevel]);
  524.                         SpawnPlayer(playerid);
  525.                         if(U_Stats[playerid][pPrisonnier] == 1){
  526.                         SetPlayerPos(playerid, 0, 0, 0);
  527.                         SetTimerEx("FreePrisoniers", U_Stats[playerid][pPrisonTime], false, "ii", playerid, U_Stats[playerid][pPrisonTime]);
  528.                         } // PRISON POS
  529.                         SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome back to NCRP!");
  530.  
  531.                 U_Stats[playerid][pPrisonnier] = 0;
  532.                 U_Stats[playerid][pPrisonTime] = 0;
  533.                 new INI:File = INI_Open(UserPath(playerid));
  534.                 INI_SetTag(File, "data");
  535.                 INI_WriteInt(File, "Skin", 17);
  536.                 INI_WriteInt(File, "Interior", 0);
  537.                 INI_WriteInt(File, "VW", 0);
  538.                 INI_WriteFloat(File, "PositionX", 1743.1300);
  539.                 INI_WriteFloat(File, "PositionY", -1861.9683);
  540.                 INI_WriteFloat(File, "PositionZ", 13.5769);
  541.                 INI_WriteInt(File, "Money", 25000);
  542.                 INI_WriteInt(File, "Level", 1);
  543.                 INI_WriteInt(File, "Job1", 0);
  544.                 INI_WriteInt(File, "Job2", 0);
  545.                 INI_WriteInt(File, "Flags", 0);
  546.                 INI_WriteInt(File, "Banned", 0);
  547.                 INI_WriteString(File, "BanBy", "0");
  548.                 INI_WriteString(File, "BanReason", "0");
  549.                 new plrIP[16];
  550.                 GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  551.                 INI_WriteString(File, "RegIP", plrIP);
  552.                 INI_WriteString(File, "LastIP", plrIP);
  553.                 INI_WriteInt(File, "Faction", 0);
  554.                 INI_WriteString(File, "Rank", "None");
  555.                 INI_WriteInt(File, "HealthCare", 0);
  556.                 INI_WriteInt(File, "Prisonnier", 0);
  557.                 INI_WriteInt(File, "PrisonTime", 0);
  558.                 INI_Close(File);
  559.  
  560.  
  561. stock ProxDetector(Float:radi, playerid, string[],color) // fixed ?? need to be tested
  562. {
  563.     new Float:x,Float:y,Float:z;
  564.     GetPlayerPos(playerid,x,y,z);
  565.     for(new player;player<MAX_PLAYERS;player++)
  566.     {
  567.         if(!IsPlayerConnected(player))continue;
  568.         if(IsPlayerInRangeOfPoint(player,radi,x,y,z))SendClientMessage(player,color,string);
  569.     }
  570. }
  571.  
  572. new cuffed[MAX_PLAYERS];
  573.  
  574. public OnPlayerDisconnect(playerid, reason)
  575. {
  576.     if(cuffed[playerid] == 1){
  577.     U_Stats[playerid][pPrisonnier] = 1;
  578.     U_Stats[playerid][pPrisonTime] = 10 * 1000 * 60;}
  579.     new INI:File = INI_Open(UserPath(playerid));
  580.     INI_SetTag(File, "data");
  581.     INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
  582.     INI_WriteInt(File, "Interior", GetPlayerInterior(playerid));
  583.     INI_WriteInt(File, "VW", GetPlayerVirtualWorld(playerid));
  584.     new Float:x, Float:y, Float:z;
  585.     GetPlayerPos(playerid, x, y, z);
  586.     INI_WriteFloat(File, "PositionX", x);
  587.     INI_WriteFloat(File, "PositionY", y);
  588.     INI_WriteFloat(File, "PositionZ", z);
  589.     INI_WriteInt(File, "Money", GetPlayerMoney(playerid));
  590.     INI_WriteInt(File, "Level", GetPlayerScore(playerid));
  591.     INI_WriteInt(File, "Job1", U_Stats[playerid][pJob1]);
  592.     INI_WriteInt(File, "Job2", U_Stats[playerid][pJob2]);
  593.     INI_WriteInt(File, "Flags", U_Stats[playerid][pFlags]);
  594.     INI_WriteInt(File, "Banned", U_Stats[playerid][pBanned]);
  595.     INI_WriteString(File, "BanBy", U_Stats[playerid][pBanBy]);
  596.     INI_WriteString(File, "BanReason", U_Stats[playerid][pBanReason]);
  597.     new plrIP[16];
  598.     GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  599.     INI_WriteString(File, "LastIP", plrIP);
  600.     INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
  601.     INI_WriteString(File, "Rank", U_Stats[playerid][pRank]);
  602.     INI_WriteInt(File, "HealthCare", U_Stats[playerid][pHealthCare]);
  603.     INI_WriteInt(File,"Prisonnier", U_Stats[playerid][pPrisonnier]);
  604.     INI_WriteInt(File,"PrisonTime", U_Stats[playerid][pPrisonTime]);
  605.     INI_Close(File);
  606.     return 1;
  607. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement