Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* afaclead - IN WORKING*/
- CMD:afaclead(playerid, params[])
- {
- if(U_Stats[playerid][pLevel] < 12) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You're not high admin enough.");
- new target, facid;
- if(sscanf(params,"ii", target, facid))
- {
- SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /afaclead [playerid] [faction_id]");
- return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] ID 1 : LSPD | ID : 2 SFPD | ID : 3 Fox5");
- }
- if(facid < 1 || facid > 3) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] Invalid Faction ID");
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}Error{FFFFFF}] The player is offline.");
- facid--;
- print("smth");
- if(U_Stats[target][pFaction] != -1 && strcmp(Factions[U_Stats[target][pFaction]-1][fLeader], GetName(playerid)) || U_Stats[target][pFaction] == -1)
- {
- U_Stats[target][pFaction] = facid+1;
- print("ssmth");
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", rankFac[facid][Factions[facid][fMaxRank]][0]);
- INI_WriteInt(File, "Faction", U_Stats[target][pFaction]);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- new INI:file = INI_Open(FactionPath(facid));
- INI_SetTag(file, "data");
- INI_WriteString(file,"Leader",GetName(playerid));
- INI_Close(file);
- INI_ParseFile(FactionPath(facid), "LoadFaction_data", .bExtra = true, .extra = facid);
- facid++;
- switch(facid)
- {
- case 1:
- {
- new message[255];
- format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Police Department.", GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, message);
- }
- case 2:
- {
- new message[255];
- format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Fire and Medicial Department.", GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, message);
- }
- case 3:
- {
- new message[255];
- format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of FOX5 News.", GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, message);
- }
- default: printf("[Error] ERROR MAKELEADER [1] | Player %s (ID:%i) | Admin %s (ID:%i)", GetName(target), target, GetName(playerid), playerid);
- }
- return 1;
- }
- else if(U_Stats[target][pFaction] != -1 && !strcmp(Factions[U_Stats[target][pFaction]-1][fLeader], GetName(playerid)))
- {
- new INI:file = INI_Open(FactionPath(U_Stats[target][pFaction]));
- INI_SetTag(file, "data");
- INI_WriteString(file,"Leader","None");
- INI_Close(file);
- INI_ParseFile(FactionPath(U_Stats[target][pFaction]), "LoadFaction_data", .bExtra = true, .extra = U_Stats[target][pFaction]);
- U_Stats[target][pFaction] = facid+1;
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", rankFac[facid][Factions[facid][fMaxRank]][0]);
- INI_WriteInt(File, "Faction", U_Stats[target][pFaction]);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- new INI:ffile = INI_Open(FactionPath(facid));
- INI_SetTag(ffile, "data");
- INI_WriteString(ffile,"Leader",GetName(playerid));
- INI_Close(ffile);
- INI_ParseFile(FactionPath(facid), "LoadFaction_data", .bExtra = true, .extra = facid);
- facid++;
- switch(facid)
- {
- case 1:
- {
- new message[255];
- format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Police Department.", GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, message);
- }
- case 2:
- {
- new message[255];
- format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of Los Angeles Fire and Medicial Department.", GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, message);
- }
- case 3:
- {
- new message[255];
- format(message, 255, "{FFFFFF}[{82CAFF}Admin{FFFFFF}] %s made %s leader of FOX5 News.", GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, message);
- }
- default: printf("[Error] ERROR MAKELEADER [2] | Player %s (ID:%i) | Admin %s (ID:%i)", GetName(target), target, GetName(playerid), playerid);
- }
- return 1;
- }
- else
- {
- printf("[Error] ERROR MAKELEADER 3 | Player %s (ID:%i) | Admin %s (ID:%i)", GetName(target), target, GetName(playerid), playerid);
- return 1;
- }
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- CMD:invit(playerid, params[])
- {
- new target;
- 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");
- if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /invit [player_id]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not connected");
- if(U_Stats[target][pFaction] != -1) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is in a faction.");
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", rankFac[U_Stats[playerid][pFaction]][0][0]);
- INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- new str[200];
- format(str, sizeof(str), "{82CAFF}ยป %s %s has invited %s in the faction!", U_Stats[playerid][pRank], GetName(playerid), GetName(target));
- FacRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- CMD:fire(playerid, params[])
- {
- new target;
- 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");
- if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /fire [player_id]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not connected");
- 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.");
- if(!strcmp(Factions[U_Stats[target][pFaction]][fLeader], GetName(playerid)))
- {
- new INI:file = INI_Open(FactionPath(U_Stats[target][pFaction]));
- INI_SetTag(file, "data");
- INI_WriteString(file,"Leader","None");
- INI_Close(file);
- INI_ParseFile(FactionPath(U_Stats[target][pFaction]), "LoadFaction_data", .bExtra = true, .extra = U_Stats[target][pFaction]);
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", "None");
- INI_WriteInt(File, "Faction", -1);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- }
- else
- {
- new INI:File = INI_Open(UserPath(target));
- INI_SetTag(File, "data");
- INI_WriteString(File, "Rank", "None");
- INI_WriteInt(File, "Faction", -1);
- INI_Close(File);
- INI_ParseFile(UserPath(target), "LoadUser_%s", .bExtra = true, .extra = target);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- }
- new str[200];
- format(str, sizeof(str), "{82CAFF}ยป %s %s has fired %s", U_Stats[playerid][pRank], GetName(playerid), GetName(target));
- FacRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- // ==============================================================================================
- // Los Angeles Police Department | Commands
- // ==============================================================================================
- //------------------------------------------------------------------------------------------------
- new IsSuspect[MAX_PLAYERS];
- new IsPrisonnier[MAX_PLAYERS];
- CMD:duty(playerid,params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- //if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You must be at the comico'");
- if(IsOnDuty[playerid] == false)
- {
- new str[128];
- IsOnDuty[playerid] = true;
- SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are now on duty");
- format(str, sizeof(str), "* %s take his badge, weapon and radio.", GetName(playerid));
- ProxDetector(15, playerid, str, 0xCC56CCFF);
- SetPlayerArmour(playerid, 100.0);
- GivePlayerWeapon(playerid, WEAPON_DEAGLE, 100);
- GivePlayerWeapon(playerid, WEAPON_NITESTICK, 1);
- GivePlayerWeapon(playerid, WEAPON_SPRAYCAN, 1000);
- return 1;
- }
- else
- {
- new str[128];
- IsOnDuty[playerid] = false;
- SendClientMessage(playerid, -1, "[{82CAFF}Infomation{FFFFFF}] You are no longer on duty");
- format(str, sizeof(str), "* %s put his badge, weapon, radio into his locker.", GetName(playerid));
- ProxDetector(15, playerid, str, 0xCC56CCFF);
- SetPlayerArmour(playerid, 0.0);
- ResetPlayerWeapons(playerid);
- return 1;
- }
- }
- //------------------------------------------------------------------------------------------------
- CMD:m(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- 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");
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /m [Message]");
- format(text, sizeof(text), "{ff0000}((%s | %s)) {FFFFFF}%s", GetName(playerid), Factions[U_Stats[playerid][pFaction]-1][fShortName], text);
- ProxDetector(30, playerid, text, -1);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:r(playerid, params[])
- {
- if(U_Stats[playerid][pFaction] == -1) return 1;
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /r [Message]");
- format(text, sizeof(text), "{1E90FF}(Radio) %s %s says: %s", U_Stats[playerid][pRank], GetName(playerid), text);
- FacRadio(playerid, text);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:d(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- new text[150];
- if(sscanf(params, "s[149]", text)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /d (regional) [Message]");
- format(text, sizeof(text), "{B4BA00}(%s) %s %s : %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], U_Stats[playerid][pRank], GetName(playerid), text);
- DepRadio(playerid, text);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:su(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- new target, reason[111];
- if(sscanf(params, "is[110]", target, reason)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /su(uspect) [target_id] [reason]");
- new str[120];
- 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);
- IsSuspect[target] = 1;
- DepRadio(playerid, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------
- CMD:arrest(playerid, params[])
- {
- if(!LawE(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You are not allowed to use this command");
- if(!duty(playerid)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] You need be on duty");
- new Float:x, Float:y, Float:z, target, time, fine;
- if(sscanf(params, "iii", target, time, fine)) return SendClientMessage(playerid, -1, "[{82CAFF}Use{FFFFFF}] /arrest [target_id] [time] [fine]");
- if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] Wrong player ID");
- if(IsSuspect[target] != 1) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] This player is not suspect!");
- GetPlayerPos(playerid, x, y, z);
- 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.");
- if(!IsPlayerInRangeOfPoint(target, 5.0, x, y, z)) return SendClientMessage(playerid, -1, "[{82CAFF}Error{FFFFFF}] The suspect need to be near you!");
- time = time * 60 * 1000;
- SetPlayerPos(target, x, y, z);
- SetTimerEx("FreePrisoniers", time, false, "ii", target, time);
- new str[150];
- format(str, sizeof(str), "[{82CAFF}%s{FFFFFF} Policier %s has arrested %s", Factions[U_Stats[playerid][pFaction]-1][fShortName], GetName(playerid), GetName(target));
- SendClientMessageToAll(-1, str);
- //SetPlayerPos(target, x, y, z);
- IsPrisonnier[target] = 1;
- return 1;
- }
- forward FreePrisoniers(suspect, time);
- public FreePrisoniers(suspect, time)
- {
- SetPlayerPos(suspect,1544.2457,-1675.5072,13.5580);
- IsSuspect[suspect] = 0;
- IsPrisonnier[suspect] = 0;
- SendClientMessage(suspect, -1, "[{82CAFF}Prison{FFFFFF}]You are now free.");
- new str[150];
- time = time / 60 / 1000;
- format(str, sizeof(str), "{82CAFF}ยป %s has been released from the prison after %i min(s)", GetName(suspect), time);
- DepRadio(-1, str);
- return 1;
- }
- //------------------------------------------------------------------------------------------------------------------------------------------------------------
- CMD:cuff(playerid, params[]) //Uses toggle version, So one cuff=cuffed, two cuff=uncuffed.
- {
- if(U_Stats[playerid][pFaction] == 0)
- {
- new target;
- if(sscanf(params, "i", target))
- {
- SendClientMessage(playerid, -1, COLOR_White_a"["COLOR_LightBlue_a"Error Usage"COLOR_White_a"] /cuff [playerid]");
- }
- else
- {
- if(!IsPlayerConnected(target))
- {
- SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] That player is offline!");
- }
- else
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(target, x, y, z);
- if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z))
- {
- if(cuffed[target] == 0)
- {
- new str[128];
- format(str, sizeof(str), "** %s grabs a pair of cuffs and slaps them onto %s's wrists.", GetRPName(playerid), GetRPName(target));
- ProxDetector(15, playerid, str, COLOR_Purple);
- SetPlayerAttachedObject(target, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
- SetPlayerSpecialAction(target, SPECIAL_ACTION_CUFFED);
- cuffed[target] = 1;
- }
- else
- {
- new str[128];
- format(str, sizeof(str), "** %s grabs a pair of cuffs keys and unlocks %s's wrists.", GetRPName(playerid), GetRPName(target));
- ProxDetector(15, playerid, str, COLOR_Purple);
- SetPlayerSpecialAction(target,SPECIAL_ACTION_NONE);
- RemovePlayerAttachedObject(target, 1);
- cuffed[target] = 0;
- }
- }
- else
- {
- SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] You're too far away.");
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] You're not a Law Enforcement Officer.");
- }
- return 1;
- }
- new tazer[MAX_PLAYERS] = 0,
- storedDeagle[MAX_PLAYERS] = 0;
- CMD:tazer(playerid, params[])
- {
- if(U_Stats[playerid][pFaction] == 0)
- {
- if(tazer[playerid] == 0)
- {
- if(GetPlayerWeapon(playerid) == 24)
- {
- storedDeagle[playerid] = 1;
- tazer[playerid] = 1;
- GivePlayerWeapon(playerid, 23, 999999);
- }
- else
- {
- storedDeagle[playerid] = 0;
- tazer[playerid] = 1;
- GivePlayerWeapon(playerid, 23, 999999);
- }
- new str[128];
- format(str, sizeof(str), "** %s unbuckles their Tazer Holster and grabs their Tazer.", GetRPName(playerid));
- ProxDetector(15, playerid, str, COLOR_Purple);
- }
- else
- {
- if(storedDeagle[playerid] == 1)
- {
- storedDeagle[playerid] = 0;
- tazer[playerid] = 0;
- GivePlayerWeapon(playerid, 24, 999999);
- }
- else
- {
- storedDeagle[playerid] = 0;
- tazer[playerid] = 0;
- SetPlayerAmmo(playerid, WEAPON_SILENCED, 0);
- }
- new str[128];
- format(str, sizeof(str), "** %s buckles their Tazer Holster and with the Tazer in.", GetRPName(playerid));
- ProxDetector(15, playerid, str, COLOR_Purple);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, ""COLOR_White_a"["COLOR_LightBlue_a"Error"COLOR_White_a"] You're not a Law Enforcement Officer.");
- }
- return 1;
- }
- stock DepRadio(playerid, string[])
- {
- if(!LawE(playerid) && playerid != -1) return 1;
- if(IsPrisonnier[playerid] == 1) return 1;
- new text[150];
- foreach(new i : Player)
- {
- if(!LawE(playerid)) continue;
- format(text, sizeof(text), "%s", string);
- SendClientMessage(i, -1, text);
- }
- return 1;
- }
- stock FacRadio(playerid, string[])
- {
- if(IsPrisonnier[playerid] == 1) return 1;
- new text[150];
- foreach(new i : Player)
- {
- if(U_Stats[playerid][pFaction] != U_Stats[i][pFaction]) continue;
- format(text, sizeof(text), "%s", string);
- SendClientMessage(i, -1, text);
- }
- return 1;
- }
- /*- Start of: Vars -*/
- enum pStats
- {
- pID,
- pPassword[128],
- pMail[128],
- pAge,
- pOrigin[128],
- pGender[128],
- pSkin,
- pInterior,
- pVW,
- Float:pPositionX,
- Float:pPositionY,
- Float:pPositionZ,
- pMoney,
- pLevel,
- pJob1,
- pJob2,
- pFlags,
- pBanned,
- pBanBy[128],
- pBanReason[128],
- pRegIP[128],
- pLastIP[128],
- pFaction,
- pRank[11],
- pHealthCare,
- pPrisonnier,
- pPrisonTime
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("ID", U_Stats[playerid][pID]);
- INI_String("Password", U_Stats[playerid][pPassword], 128);
- INI_String("Mail", U_Stats[playerid][pMail], 128);
- INI_Int("Age", U_Stats[playerid][pAge]);
- INI_String("Origin", U_Stats[playerid][pOrigin], 128);
- INI_String("Gender", U_Stats[playerid][pGender], 128);
- INI_Int("Skin", U_Stats[playerid][pSkin]);
- INI_Int("Interior", U_Stats[playerid][pInterior]);
- INI_Int("VW", U_Stats[playerid][pVW]);
- INI_Float("PositionX", U_Stats[playerid][pPositionX]);
- INI_Float("PositionY", U_Stats[playerid][pPositionY]);
- INI_Float("PositionZ", U_Stats[playerid][pPositionZ]);
- INI_Int("Money", U_Stats[playerid][pMoney]);
- INI_Int("Level", U_Stats[playerid][pLevel]);
- INI_Int("Job1", U_Stats[playerid][pJob1]);
- INI_Int("Job2", U_Stats[playerid][pJob2]);
- INI_Int("Flags", U_Stats[playerid][pFlags]);
- INI_Int("Banned", U_Stats[playerid][pBanned]);
- INI_String("BanBy", U_Stats[playerid][pBanBy], 128);
- INI_String("BanReason", U_Stats[playerid][pBanReason], 128);
- INI_String("RegIP", U_Stats[playerid][pRegIP], 128);
- INI_String("LastIP", U_Stats[playerid][pLastIP], 128);
- INI_Int("Faction", U_Stats[playerid][pFaction]);
- INI_String("Rank", U_Stats[playerid][pRank], 11);
- INI_Int("HealthCare", U_Stats[playerid][pHealthCare]);
- INI_Int("Prisonnier", U_Stats[playerid][pPrisonnier]);
- INI_Int("PrisonTime", U_Stats[playerid][pPrisonTime]);
- return 1;
- }
- SpawnPlayer(playerid);
- 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 );
- TogglePlayerSpectating(playerid, 0);
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- SpawnPlayer(playerid);
- SetPlayerSkin(playerid, U_Stats[playerid][pSkin]);
- SetPlayerInterior(playerid, U_Stats[playerid][pInterior]);
- SetPlayerVirtualWorld(playerid, U_Stats[playerid][pVW]);
- SetPlayerPos(playerid, U_Stats[playerid][pPositionX], U_Stats[playerid][pPositionY], U_Stats[playerid][pPositionZ]);
- GivePlayerMoney(playerid, U_Stats[playerid][pMoney]);
- SetPlayerScore(playerid, U_Stats[playerid][pLevel]);
- SpawnPlayer(playerid);
- if(U_Stats[playerid][pPrisonnier] == 1){
- SetPlayerPos(playerid, 0, 0, 0);
- SetTimerEx("FreePrisoniers", U_Stats[playerid][pPrisonTime], false, "ii", playerid, U_Stats[playerid][pPrisonTime]);
- } // PRISON POS
- SendClientMessage(playerid, -1, "{FFFFFF}[{82CAFF}NCRP{FFFFFF}] Welcome back to NCRP!");
- U_Stats[playerid][pPrisonnier] = 0;
- U_Stats[playerid][pPrisonTime] = 0;
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Skin", 17);
- INI_WriteInt(File, "Interior", 0);
- INI_WriteInt(File, "VW", 0);
- INI_WriteFloat(File, "PositionX", 1743.1300);
- INI_WriteFloat(File, "PositionY", -1861.9683);
- INI_WriteFloat(File, "PositionZ", 13.5769);
- INI_WriteInt(File, "Money", 25000);
- INI_WriteInt(File, "Level", 1);
- INI_WriteInt(File, "Job1", 0);
- INI_WriteInt(File, "Job2", 0);
- INI_WriteInt(File, "Flags", 0);
- INI_WriteInt(File, "Banned", 0);
- INI_WriteString(File, "BanBy", "0");
- INI_WriteString(File, "BanReason", "0");
- new plrIP[16];
- GetPlayerIp(playerid, plrIP, sizeof(plrIP));
- INI_WriteString(File, "RegIP", plrIP);
- INI_WriteString(File, "LastIP", plrIP);
- INI_WriteInt(File, "Faction", 0);
- INI_WriteString(File, "Rank", "None");
- INI_WriteInt(File, "HealthCare", 0);
- INI_WriteInt(File, "Prisonnier", 0);
- INI_WriteInt(File, "PrisonTime", 0);
- INI_Close(File);
- stock ProxDetector(Float:radi, playerid, string[],color) // fixed ?? need to be tested
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- for(new player;player<MAX_PLAYERS;player++)
- {
- if(!IsPlayerConnected(player))continue;
- if(IsPlayerInRangeOfPoint(player,radi,x,y,z))SendClientMessage(player,color,string);
- }
- }
- new cuffed[MAX_PLAYERS];
- public OnPlayerDisconnect(playerid, reason)
- {
- if(cuffed[playerid] == 1){
- U_Stats[playerid][pPrisonnier] = 1;
- U_Stats[playerid][pPrisonTime] = 10 * 1000 * 60;}
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Skin", GetPlayerSkin(playerid));
- INI_WriteInt(File, "Interior", GetPlayerInterior(playerid));
- INI_WriteInt(File, "VW", GetPlayerVirtualWorld(playerid));
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- INI_WriteFloat(File, "PositionX", x);
- INI_WriteFloat(File, "PositionY", y);
- INI_WriteFloat(File, "PositionZ", z);
- INI_WriteInt(File, "Money", GetPlayerMoney(playerid));
- INI_WriteInt(File, "Level", GetPlayerScore(playerid));
- INI_WriteInt(File, "Job1", U_Stats[playerid][pJob1]);
- INI_WriteInt(File, "Job2", U_Stats[playerid][pJob2]);
- INI_WriteInt(File, "Flags", U_Stats[playerid][pFlags]);
- INI_WriteInt(File, "Banned", U_Stats[playerid][pBanned]);
- INI_WriteString(File, "BanBy", U_Stats[playerid][pBanBy]);
- INI_WriteString(File, "BanReason", U_Stats[playerid][pBanReason]);
- new plrIP[16];
- GetPlayerIp(playerid, plrIP, sizeof(plrIP));
- INI_WriteString(File, "LastIP", plrIP);
- INI_WriteInt(File, "Faction", U_Stats[playerid][pFaction]);
- INI_WriteString(File, "Rank", U_Stats[playerid][pRank]);
- INI_WriteInt(File, "HealthCare", U_Stats[playerid][pHealthCare]);
- INI_WriteInt(File,"Prisonnier", U_Stats[playerid][pPrisonnier]);
- INI_WriteInt(File,"PrisonTime", U_Stats[playerid][pPrisonTime]);
- INI_Close(File);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement