05.07.2012, 18:37
hello, im using Yini and got it set up etc but when i look in my config file there is nothing(no admin etc)
here is my script:
here is my script:
pawn Код:
// i take hardly any credits for the include as i made only 50% of it
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*\
|| ||
|| Started Creating on the 22nd June 2012 By Brennan Butler (brennan9723@hotmail.com). ||
|| This is a script for SFCNR(San Fierro Cops And Robbers) ||
|| This game mode is using yini ||
|| ||
|| ||
\*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
//==============================[INCLUDES]======================================//
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>
#include <streamer>
#include <foreach>
#include <sfcnr>
native WP_Hash(buffer[],len,const str[]);
//============================[OTHER]=========================================//
forward SetPlayerRandomSpawn(playerid);
new bool:Spawned[MAX_PLAYERS];
/*native SendClientMessageToAdmins(const str[]);
native Announce(const str[]);
native SendRadioMessageToCops(const str[]);
native SendRadioMessageToMedics(const str[]);
native SendRadioMessageToHitmen(const str[]);
native GivePlayerScore(playerid, score);
native GivePlayerWantedLevel(playerid, level);
native IsPlayerSpawned(playerid);
native GetPlayerBankCash(playerid);
native SetPlayerBankCash(playerid, cash);
native GetPlayerAdminLevel(playerid);
native SetPlayerAdminLevel(playerid, level);
native GetPlayerRobbingSkill(playerid);
native SetPlayerRobbingSkill(playerid, skill);
native GetPlayerTerrorSkill(playerid);
native SetPlayerTerrorSkill(playerid, skill);
native GetPlayerWarnings(playerid);
native SetPlayerWarnings(playerid, warns);
native SetPlayerJailed(playerid, bool);
native GetPlayerC4Amount(playerid);
native SetPlayerC4Amount(playerid, amount);
native GetPlayerDrugs(playerid);
native SetPlayerDrugs(playerid, amount);
native IsPlayerJailed(playerid);
native IsPlayerBarOwner(playerid);
forward SetupPlayerForClassSelection(playerid);
forward PayDay(playerid);
forward ForumP();
forward ScoreTimer(playerid);
forward Wank(playerid);
forward IsNumeric(const string[]);
forward SetPlayerRandomSpawn(playerid);
forward CluckinJob(playerid);
forward WellSTimer(playerid);
forward BurgerTimer(playerid);
forward Unfreeze(playerid);
forward OnPlayerTazePlayer(playerid);
forward CheckStatus();
forward AntiTK();
forward TimeUpdate();
forward WantedLevel();
forward Float:GetDistanceBetweenPlayers(p1, p2);
forward ShowCarListMenu(playerid);
forward Unjail();
forward ResetParamedicWeapons();
forward DriverSalary();
forward SafeSetPlayerPos(playerid, Float:x, Float:y, Float:z);*/
forward loadaccount_user(playerid, name[], value[]);
//============================[DEFINES]==========================================//
#define IsPlayerSpawned(%1) Spawned[%1]
#define dregister 2011
#define dlogin 2012
#define UserPath "Sfcnr/Users/%s.ini"
#define DIALOG_CRIMES 5
#define COLOR_ORANGE 0xFF8000FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BLUE1 0x0066FFFF
#define COLOR_RED 0xAA3333AA
#define COLOR_RED2 0xFF0000FF
#define COLOR_REALRED 0xFF0606FF
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_VIP 0xC93CCE00
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLACK 0x000000AA
#define COLOR_MAROON #800000
//============================[CLASS DEFINES]==========================================//
#define STAT 1
#define SWAT 2
#define ARMY 3
#define POLICE 4
#define RAPIST 5
#define MECHANIC 6
#define PARAMEDIC 7
#define HITMAN 8
#define DRUG 9
#define ROB 10
#define WEP 11
#define ITEMS 12
#define KIDNAPPER 13
#define PEDO 14
#define TRUCKER 15
#define TAXI 16
#define TEROIST 17
#define CIVILIAN 18
#define COLOR_STAT COLOR_ORANGE
#define COLOR_SWAT COLOR_LIGHTBLUE
#define COLOR_ARMY COLOR_TAN
#define COLOR_POLICE COLOR_BLUE
#define COLOR_CIVILIAN COLOR_WHITE
#define COLOR_MECHANIC COLOR_GREY
#define COLOR_PARAMEDIC COLOR_INDIGO
#define COLOR_HITMAN COLOR_WHITE
new gTeam[MAX_PLAYERS];
new Weed[MAX_PLAYERS];
new Water[MAX_PLAYERS];
new pWeed[MAX_PLAYERS];
new PlantedWeed[MAX_PLAYERS];
new wBusy[MAX_PLAYERS];
new cuffed[MAX_PLAYERS];
new Tazed[MAX_PLAYERS];
new DrugTimer[MAX_PLAYERS];
new Gateopen[MAX_PLAYERS];
main()
{
print("\n||====================================================||");
print("|| Sfcnr Include made by brennan butler(not all) ||");
print("|| only for the use of sfcnr made by Brennan &||");
print("|| Josip ||");
print("||====================================================||\n");
print("\n*********************************");
print(" San Fierro Cops And Robbers");
print(" Owned by thefatshizms and Joseph");
print(" devolped by thefatshizms");
print("**********************************\n");
}
enum PInfo
{
Pusername[25],
Ppassword[24],
Pscore,
Pmoney,
Pbank,
Pstat,
Parmy,
Pswat,
Padmin,
Pcop,
Pregdate,
Preg,
Preport,
Pwarned,
Pprison,
Phelper,
Pemail[255],
Pvip,
Ptime,
Parrest,
Psurender,
Prob,
Prape,
Pheal,
Phitmanlvl,
Psales,
Pwepd,
Pgmem,
Pgown,
Ptruck
}
new PlayerInfo[MAX_PLAYERS][PInfo];
public OnGameModeInit()
{
CreateVehicle(411,-2270.60009766,2288.60009766,4.59999990,270.00000000,-1,6,15); //Infernus
CreateVehicle(411,-2270.60009766,2285.69995117,4.59999990,270.00000000,-1,6,15); //Infernus
CreateVehicle(411,-2270.39990234,2291.50000000,4.59999990,270.00000000,-1,6,15); //Infernus
CreateVehicle(560,-2270.00000000,2294.39990234,4.59999990,270.00000000,-1,-1,15); //Sultan
CreateVehicle(560,-2269.89990234,2297.19995117,4.59999990,270.00000000,25,1,15); //Sultan
CreateVehicle(560,-2270.30004883,2300.19995117,4.59999990,270.00000000,25,1,15); //Sultan
CreateVehicle(528,-2270.80004883,2303.60009766,4.80000019,268.00000000,-1,-1,15); //FBI Truck
CreateVehicle(528,-2270.50000000,2306.50000000,5.00000000,267.99499512,-1,-1,15); //FBI Truck
CreateVehicle(528,-2270.80004883,2309.50000000,5.00000000,267.99499512,-1,-1,15); //FBI Truck
CreateVehicle(490,-2271.00000000,2312.30004883,5.09999990,270.00000000,-1,6,15); //FBI Rancher
CreateVehicle(490,-2271.00000000,2315.39990234,5.09999990,270.00000000,-1,6,15); //FBI Rancher
CreateVehicle(490,-2271.10009766,2318.30004883,5.09999990,270.00000000,-1,6,15); //FBI Rancher
CreateVehicle(432,-2271.10009766,2324.89990234,4.90000010,268.00000000,-1,-1,15); //Rhino
CreateVehicle(432,-2233.50000000,2307.10009766,5.40000010,89.99499512,-1,-1,15); //Rhino
CreateVehicle(432,-2293.19995117,2232.89990234,5.09999990,1.99450684,-1,-1,15); //Rhino
CreateVehicle(469,-2223.69995117,2328.30004883,7.59999990,0.00000000,-1,-1,15); //Sparrow
CreateVehicle(469,-2233.60009766,2327.10009766,7.59999990,0.00000000,-1,-1,15); //Sparrow
CreateObject(987,-2269.39990234,2357.00000000,4.00000000,0.00000000,0.00000000,236.00000000); //object(elecfence_bar) (1)
CreateObject(987,-2269.10009766,2357.00000000,4.00000000,0.00000000,0.00000000,57.99731445); //object(elecfence_bar) (2)
CreateObject(987,-2262.69995117,2367.10009766,4.19999981,0.00000000,0.00000000,57.99682617); //object(elecfence_bar) (3)
CreateObject(987,-2281.39990234,2336.69995117,4.00000000,0.00000000,0.00000000,63.99682617); //object(elecfence_bar) (4)
CreateObject(987,-2299.89990234,2337.10009766,4.00000000,0.00000000,0.00000000,177.99536133); //object(elecfence_bar) (5)
CreateObject(987,-2186.60009766,2424.50000000,0.20000000,0.00000000,0.00000000,133.99499512); //object(elecfence_bar) (6)
CreateObject(987,-2219.60009766,2457.80004883,0.00000000,0.00000000,0.00000000,133.99475098); //object(elecfence_bar) (7)
UsePlayerPedAnims();
SetGameModeText("Cops And Robbers");
AddPlayerClass(165,-2237.7124,2353.5083,4.9804,134.5635,0,0,0,0,0,0);// stat spawn
AddPlayerClass(166,-2237.7124,2353.5083,4.9804,134.5635,0,0,0,0,0,0);// stat spawn
AddPlayerClass(287,-1345.5194,500.1661,18.2344,10.9961,0,0,0,0,0,0);// army spawn
AddPlayerClass(179,-1345.5194,500.1661,18.2344,10.9961,0,0,0,0,0,0);// army spawn
AddPlayerClass(285,-993.0158,-700.1477,32.0078,5.8923,0,0,0,0,0,0);// swat
AddPlayerClass(265,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(266,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(267,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(280,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(281,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(282,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(283,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(284,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(288,-1598.2743,731.5563,-4.9063,10.5301,0,0,0,0,0,0);//Police
AddPlayerClass(0,-1397.8112,-313.0121,14.1484,124.1484,0,0,0,0,0,0);//driver
AddPlayerClass(0,-2079.6611,-482.9718,38.7344,180.8663,0,0,0,0,0,0);// civilian 1
AddPlayerClass(0,-2718.9888,-318.4344,7.8438,55.5373,0,0,0,0,0,0);// civilian 2
AddPlayerClass(0,-2765.9897,375.4386,6.3347,278.5965,0,0,0,0,0,0);// civilian 3
AddPlayerClass(0,-2767.3179,788.7258,52.7813,262.3263,0,0,0,0,0,0);// civilian 4
AddPlayerClass(0,-2442.7800,752.9677,35.1719,179.2369,0,0,0,0,0,0); // civilian 5
AddPlayerClass(0,-2359.2136,1006.7867,50.6953,87.5064,0,0,0,0,0,0);// civilian 6
AddPlayerClass(0,-1725.3872,1356.5693,7.1799,107.8884,0,0,0,0,0,0);// civilian 7
AddPlayerClass(0,-1985.3896,665.8715,46.5683,275.6404,0,0,0,0,0,0);// civilian 8
AddPlayerClass(0,-2383.1177,-584.4406,132.1172,90.4442,0,0,0,0,0,0);// civilian 9
AddPlayerClass(0,-1989.2987,1118.1178,54.4688,272.2214,0,0,0,0,0,0);// civilian 10
AddPlayerClass(0,-2651.2454,609.7889,14.4531,191.8591,0,0,0,0,0,0);// medic
AddPlayerClass(0,-2126.3201,239.8671,37.3500,292.8224,0,0,0,0,0,0);// terosist
AddPlayerClass(0,-2030.6611,156.5619,28.8359,272.7437,0,0,0,0,0,0);// mechanic
AddPlayerClass(0,-1712.3699,7.4375,3.5547,316.8104,0,0,0,0,0,0);// hitman
return 1;
}
public OnGameModeExit()
{
return 1;
}
public loadaccount_user(playerid, name[], value[])
{
INI_String("Ppassword", PlayerInfo[playerid][Ppassword],24);
INI_Int("Padmin",PlayerInfo[playerid][Padmin]);/*We will use INI_Int to load user's admin level. INI_Int stands for INI_Integer. This load an admin level. */
INI_Int("Pvip",PlayerInfo[playerid][Pvip]);//As explained above
INI_Int("Pmoney",PlayerInfo[playerid][Pmoney]); //As explained above
INI_Int("Pscore",PlayerInfo[playerid][Pscore]);//As explained above
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1220.0737,-6.3703,1001.3281);
SetPlayerInterior(playerid,2);
SetPlayerFacingAngle(playerid,92.3402);
SetPlayerCameraPos(playerid,1214.3527,-6.4071,1001.3290);
SetPlayerCameraLookAt(playerid, 1220.0737,-6.3703,1000.3281);
switch(classid)
{
case 0..1:
{
GameTextForPlayer(playerid, "~y~~h~STAT", 5000, 6);
gTeam[playerid] = STAT;
}
case 2..3:
{
GameTextForPlayer(playerid, "~b~~h~ARMY", 5000, 6);
gTeam[playerid] = ARMY;
}
case 4:
{
GameTextForPlayer(playerid, "SWAT", 5000, 6);
gTeam[playerid] = SWAT;
}
case 5..13:
{
GameTextForPlayer(playerid, "~b~POLICE", 5000, 6);
gTeam[playerid] = POLICE;
}
case 14:
{
GameTextForPlayer(playerid, "~b~DRIVER", 5000, 6);
gTeam[playerid] = TAXI;
}
case 15..24:
{
GameTextForPlayer(playerid, "~w~CIVILIAN", 5000, 6);
gTeam[playerid] = CIVILIAN;
}
case 25:
{
GameTextForPlayer(playerid, "~b~MEDIC", 5000, 6);
gTeam[playerid] = PARAMEDIC;
}
case 26:
{
GameTextForPlayer(playerid, "~r~TEROIST", 5000, 6);
gTeam[playerid] = TEROIST;
}
case 27:
{
GameTextForPlayer(playerid, "~g~MECHANIC", 5000, 6);
gTeam[playerid] = MECHANIC;
}
case 28:
{
GameTextForPlayer(playerid, "~b~HITMAN", 5000, 6);
gTeam[playerid] = HITMAN;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
SendDeathMessage(playerid, INVALID_PLAYER_ID, 200);
Weed[playerid] =0;
Water[playerid] =0;
pWeed[playerid] =0;
PlantedWeed[playerid] =0;
wBusy[playerid] =0;
new string[128];
format(string, sizeof(string), "%s Has joined San Fierro Cops And Robbers!", PlayerName(playerid));
SendClientMessageToAll(COLOR_GREY, string);
cuffed[playerid] =0;
Spawned[playerid] =false;
Tazed[playerid] =0;
new name[MAX_PLAYER_NAME]; //Making a new variable called 'name'. name[MAX_PLAYER_NAME] is created so we can use it to get player's name.
GetPlayerName(playerid,name,sizeof(name)); //Get player's name
if(fexist(Path(playerid))) /* Check if the connected user is registered or not. fexist stands for file exist. So if file exist in the files(Path(playerid)),*/
{// then
INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account","Login","Quit");/*A dialog with input style will appear so you can insert your password to login.*/
}
else //If the connected user is not registered,
{//then we will 'force' him to register :)
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.","Register","Quit");
return 1;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
new string[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s[%d] left the server. (Timeout/Crash)",name);
case 1: format(string,sizeof string,"%s[%d] left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s[%d] left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(COLOR_GREY,string);
if(fexist(Path(playerid)))//Will check if the file is exit or not inside of User's folder that we have created.
{
new INI:file = INI_Open(Path(playerid)); //will open their file
INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
INI_WriteInt(file,"Padmin",PlayerInfo[playerid][Padmin]); //If you've set his/her admin level, then his/her admin level will be saved inside of his/her account
INI_WriteInt(file,"Pvip",PlayerInfo[playerid][Pvip]);//As explained above
INI_WriteInt(file,"Pmoney",GetPlayerMoney(playerid));//We will save his money inside of his account
INI_WriteInt(file,"Pscore",GetPlayerScore(playerid));//We will save his score inside of his account
INI_Close(file);//Now after we've done saving their data, we now need to close the file
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
Spawned[playerid] = false;
SendDeathMessage(killerid, playerid, reason);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerSpawn(playerid)
{
TogglePlayerControllable(playerid, 1);
SetPlayerInterior(playerid, 0);
if(gTeam[playerid] == STAT)
{
SendClientMessage(playerid, -1, "Welcome to stat");
SendClientMessage(playerid, -1, "You can do /class to see help for your class/team");
return 1;
}
else if(gTeam[playerid] == SWAT)
{
SendClientMessage(playerid, -1, "Welcome to swat");
SendClientMessage(playerid, -1, "You can do /class to see help for your class/team");
SetPlayerColor(playerid, COLOR_LIGHTBLUE);
return 1;
}
return 1;
}
/*public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
*/
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, -1, "You have entered a vehicle use /vm for the vehicle menu");
}
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success) {
printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
new pip[16];
foreach(Player,i) {
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true)) {
SendClientMessage(i, 0xFFFFFFFF, "Wrong Password.");
SendClientMessage(i, -1, "dont try to login if ur not admin");
}
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == dregister)
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
return 1;
}
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteString(file,"Ppassword",hashpass);
INI_WriteInt(file,"Padmin",0);
INI_WriteInt(file,"Pvip",0);
INI_WriteInt(file,"Pmoney",0);
INI_WriteInt(file,"Pscore",0);
INI_Close(file);
SendClientMessage(playerid,-1,"You have been successfully registered");
}
}
if(dialogid == dlogin)
{
if(!response) return Kick(playerid);
if(response)
{
new hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass,PlayerInfo[playerid][Ppassword]))
{
INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
SetPlayerScore(playerid,PlayerInfo[playerid][Pscore]);
GivePlayerMoney(playerid,PlayerInfo[playerid][Pmoney]);
SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");
}
else
{
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");//We will tell to them that they've entered an incorrect password
return 1;
}
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//======================================[GEANRUALCOMMANDS]==================================//
CMD:me(playerid, params[])
{
new msg[100];
if(sscanf(params,"s[100]",msg)) return SendClientMessage(playerid, -1, "USAGE: /me <messaage>");
if(GetPlayerMoney(playerid) < 30) return SendClientMessage(playerid, COLOR_RED, "You dont have enough cash");
GivePlayerMoney(playerid, -30);
format(msg, sizeof(msg), "** %s: %s", PlayerName(playerid), msg);
SendClientMessageToAll(COLOR_PURPLE, msg);
return 1;
}
CMD:pm(playerid, params[]) {
new ID, string[128], msg[56], string2[128];
if(sscanf(params,"us[56]",ID,msg)) return SendClientMessage(playerid,0xA70000FF,"Syntax: /PM [ID] [Message].");
format(string,sizeof(string),"** PM to %s: {A70000}%s",PlayerName(ID),msg);
SendClientMessage(playerid,0xFFFFFFFF,string);
format(string2,sizeof(string2),"** PM from %s: {A70000}%s",PlayerName(playerid),msg);
SendClientMessage(ID, 0xFFFFFFFF, string2);
GameTextForPlayer(playerid, "~r~PM ~b~sent!", 3000, 1);
GameTextForPlayer(ID, "~r~PM ~b~recived!", 3000, 1);
return true;
}
CMD:crime(playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, -1, "Crimes - What you can get wanted for!");
ShowPlayerDialog(playerid, DIALOG_CRIMES, DIALOG_STYLE_MSGBOX, "Crimes!", "Using weed\nPlanting weed\nSelling weed\nRobing\nRaping\nMurder\nCar jacking(police)\nNot paying your fines\nNot paying tax", "ok", "close");
return 1;
}
CMD:w(playerid, params[])
{
new message[50];
if(sscanf(params,"s[50]",message)) return SendClientMessage(playerid, -1, "USAGE: /w <message>");
format(message, sizeof(message), "%s: {A70000}%s", PlayerName(playerid), message);
ProxDetector(10, playerid, message, COLOR_YELLOW);
SetPlayerChatBubble(playerid, message, 10, COLOR_YELLOW, 4000);
return 1;
}
CMD:kill(playerid, params[])
{
new string[128];
format(string, sizeof(string), "%s has killed himself!(/kill)", PlayerName(playerid));
SetPlayerHealth(playerid, 0);
SendClientMessageToAll(-1, string);
return 1;
}
//=======================[SPECIAL CLASS COMMADNS]===============================//
//====================================[ANIM COMMANDS]===================================//
CMD:dance(playerid, params[])
{
new dance;
if(sscanf(params, "d", dance))
return SendClientMessage(playerid, -1, "* USE: /dance [1-4]");
if(dance == 1) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE1); }
else if(dance == 2) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE2); }
else if(dance == 3) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3); }
else if(dance == 4) { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE4); }
else { SendClientMessage(playerid, -1, "* USE: /dance [1-4]"); return 1; }
return 1;
}
CMD:smokeweed(playerid, params[])
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
return 1;
}
CMD:handsup(playerid, params[])
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return 1;
}
//==================================[ADMIN SYSTEM]===================================//
CMD:class(playerid, params[])
{
new id, string[128], string2[128];
if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1, "USAGE: /class <id>");
format(string, sizeof(string), "You have forced %s to go to class selection", PlayerName(id));
format(string2, sizeof(string2), "You have been forced to class selection by %s", PlayerName(playerid));
SendClientMessage(playerid, -1, string);
SendClientMessage(id, -1, string2);
ForceClassSelection(playerid);
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
return 1;
}
CMD:getall(playerid, params[])
{
#pragma unused params
allhere(playerid);
return 1;
}
CMD:dveh(playerid, params[])
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
return 1;
}
//================================[COMMANDS FOR TESTING]==========================//
CMD:cash(playerid, params[])
{
new ammount, id;
if(sscanf(params,"ui",id,ammount)) return SendClientMessage(playerid, -1, "USAGE: /cash <id> <ammount>");
GivePlayerMoney(id, ammount);
return 1;
}
stock Path(playerid)
{
new str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),UserPath,name);
return str;
}