[HELP] My Tester Game mode (RealityC)
#6

Код HTML:
    //==================================Vehicle Commands=========================================================
COMMAND:engine(playerid, params[])
{
    #pragma unused params
    new vehicleid = GetPlayerVehicleID(playerid);
    if(Engine[vehicleid] == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "Engine Starting...");
        SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
    }
    else if(Engine[vehicleid] == 1)
    {
        Engine[vehicleid] = 0;
        SendClientMessage(playerid, COLOR_RED, "Engine Stopped...");
        SendClientMessage(playerid, COLOR_YELLOW, "To exit the vehicle press (F Key) Or (Enter)");
        SendClientMessage(playerid, COLOR_YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
    }
    return 1;
}
//=================================================MECHANIC JOB=================================================
COMMAND:joinmech(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid,30,358.2392,168.5199,1008.3828)) // MECHANIC
 	{
  		SendClientMessage(playerid, COLOR_GREY,"Congratulations on your job, please do /jobhelp for commands");
   		PInfo[playerid][JOB] = 1;
   	}
    return 1;
}
//==========================================Business system=====================================================
COMMAND:bizzhelp(playerid, params)
{
	SendClientMessage(playerid, COLOR_GREY,"--------|Business Prices|-------");
	SendClientMessage(playerid, COLOR_GREY,"24/7 - 15,0000 | Ads - 40,000");
	SendClientMessage(playerid, COLOR_GREY,"Purchases go on forums.");
	return 1;
 }
//==========================================House Help=====================================================
COMMAND:househelp(playerid, params)
{
    SendClientMessage(playerid, COLOR_GREY,"--------|House Prices|-------");
    SendClientMessage(playerid, COLOR_GREY,"Caravan - 7,500, Average - 15,000");
    SendClientMessage(playerid, COLOR_GREY,"To buy a house you have to post on forums with the location");
    return 1;
}
//=======================================PHONE SYSTEM========================================================
COMMAND:cellphonehelp(playerid,params)
{
	SendClientMessage(playerid, COLOR_GREY,"/sms [id], /turnoffphone, /r");
	SendClientMessage(playerid, COLOR_GREY,"/SMS - Phone Texting");
	SendClientMessage(playerid, COLOR_GREY,"/turnoffphone - Turns off phone");
	SendClientMessage(playerid, COLOR_GREY,"/r- Incoming Texts");
return 1;
}

COMMAND:turnoffphone(playerid,params[])
{
    #pragma unused params
    if(GetPVarInt(playerid,"NoPM") == 1)
    {
        SetPVarInt(playerid,"NoPM", 0);
        SendClientMessage(playerid, 0xFFFF00FF, "Phone's on!");
    }
    else
    {
        SetPVarInt(playerid,"NoPM", 1);
        SendClientMessage(playerid, 0xFFFF00FF, "Phone's off!");
    }
    return 1;
}

COMMAND:sms(playerid,params[])
{
    if(PInfo[playerid][PHONE] == 0) return SendClientMessage(playerid, COLOR_RED,"You do not own a cellphone");
    new id,string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
    id = strval(params);
    if(strlen(params) == 0) return SendClientMessage(playerid,0xF2A337FF,"USAGE: /sms [id][text]");
    if(GetPVarInt(id,"NoPM") == 1) return SendClientMessage(playerid,0xFF0000FF,"That player isnt recieving pm's");
    GetPlayerName(playerid,pName,sizeof(pName));
    GetPlayerName(id,pName2,sizeof(pName2));
    format(string,sizeof(string),"SMS from %s: %s",pName,params);
    SendClientMessage(id,0xFFFF00FF,string);
    format(string,sizeof(string),"SMS sent to %s: %s",pName2,params);
    SendClientMessage(playerid,0xF2A337FF,string);
    SetPVarInt(id,"LastID",playerid);
    return 1;
}

COMMAND:r(playerid,params[])
{
	new string[256],pName[MAX_PLAYER_NAME],pName2[MAX_PLAYER_NAME];
	if(strlen(params) == 0) return SendClientMessage(playerid,0xF2A337FF,"USAGE: /r [text]");
	if(GetPVarInt(playerid,"LastID") == -1) return SendClientMessage(playerid,0xFF0000FF,"No recent messages!");
	if(GetPVarInt(GetPVarInt(playerid,"LastID"),"NoPM") == 1) return SendClientMessage(playerid,0xFF0000FF,"That player isnt recieving pm's");
	GetPlayerName(playerid,pName,sizeof(pName));
	GetPlayerName(GetPVarInt(playerid,"LastID"),pName2,sizeof(pName2));
	format(string,sizeof(string),"PM from %s: %s",pName,params);
	SendClientMessage(GetPVarInt(playerid,"LastID"),0xFFFF00FF,string);
	format(string,sizeof(string),"PM sent to %s: %s",pName2,params);
	SendClientMessage(playerid,0xF2A337FF,string);
	SetPVarInt(GetPVarInt(playerid,"LastID"),"LastID",playerid);
 	return 1;
}
//=================================================HOUSE SYSTEM========================================================
COMMAND:createhouse(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You aren't an admin!");//Check if the player is currently rcon logged in.
    new HousePrice,id = HouseCount;//Creating the house price for the selected value in the command, and the last house id created.
    if(sscanf(params,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>");//Checking if the player uses the correct syntax. The parameter "i" in sscanf means integer, also could be used as "d".
    new Float:x,Float:y,Float:z;//Creating the floats, to store the player's position.
    GetPlayerPos(playerid,x,y,z);//Getting the player's position and storing it
    HInfo[id][Price] = HousePrice;//Setting the house price to the selected one.
    HInfo[id][Owned] = 0;//Setting the house id owned = 0
    HInfo[id][XPos] = x;//Storing the XPos value to the player's x.
    HInfo[id][YPos] = y;//Storing the YPos value to the player's y.
    HInfo[id][ZPos] = z;//Storing the ZPos value to the player's z.
    HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
    format(HInfo[id][Owner],24,"Nonusablenameforthishouse");//Formating the "Owner" house id value to "Nonusablenameforthishouse".
    SendClientMessage(playerid,-1,"House created");
    HouseEnter[id]  = CreateDynamicCP(x,y,z,1.5,GetPlayerVirtualWorld(playerid));//Creating the checkpoint and storing it in the HouseEnter value.
    HouseExit[id] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,GetPlayerVirtualWorld(playerid));//Creating the house exit checkpoint and storing it in the HouseExit value.
        new file[40],labelstring[100];//Creating the "file", and the labelstring var.
    format(file,sizeof(file),"RealityC/houses/%i.ini",id);//Formating the var to the selected house directory.
    INI_Open(file);//Opening the file with SII.
    INI_WriteInt("Price",HousePrice);//Writing in the place "Price" the inputted "Price" value.
    INI_WriteInt("Owned",0);//Setting to "Owned" = 0 in the ini file.
    INI_WriteInt("VirtualWorld",GetPlayerVirtualWorld(playerid));//Writing "VirtualWorld" = GetPlayerVirtualWorld(..);
    INI_WriteFloat("XPos",x);//Writing the players pos for the check point position.
    INI_WriteFloat("YPos",y);//Self explanatory.
    INI_WriteFloat("ZPos",z);//Self explanatory.
    INI_WriteString("Owner","Nonusablenameforthishouse");//Writing a string in "Owned" to "Nonusablenameforthishouse"
    INI_Save();//Saving file with SII.
    INI_Close();//Closing the file with SII.
    format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HousePrice);
    HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
    HouseCount++;
    return 1;
}

COMMAND:buyhouse(playerid,params[])
{
    for(new i = 0; i < MAX_HOUSES;i++)//Loop threw all houses.
    {
        if(!IsPlayerInRangeOfPoint(playerid,8.0,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos])) continue;//Check if the player is near a house checkpoint
        if(GetPlayerMoney(playerid) < HInfo[i][Price]) return SendClientMessage(playerid,-1,"You don't have enough money");//Checking the players money, to see if he has enough to buy the house.
        if(HInfo[i][Owned] == 1) return SendClientMessage(playerid,-1,"This house is already owned");//Checking if the house is already owned.
        HInfo[i][Owned] = 1;//Setting the house owned var to 1.
        new file[60],pName[24],string[100];//Creating the necessary vars.
        GetPlayerName(playerid,pName,sizeof(pName));//Retrieving the player's name.
        format(HInfo[i][Owner],24,"%s",pName);//Setting the House Owner's var
        format(file,sizeof(file),"RealityC/houses/%i.ini",i);//Formating the house file
        INI_Open(file);//Opening the house file
        INI_WriteInt("Owned",1);//Setting in the ini file "Owned" to 1
        INI_WriteString("Owner",pName);//Setting the "Owner" to the player's name.
        INI_Save();//Saving the ini
        INI_Close();//Closing the ini
        format(string,sizeof(string),"Owned: Yes \nPrice: %i \nOwner: %s",HInfo[i][Price],pName);//Formating the string, so we can update the label of the house
        Update3DTextLabelText(HInfo[i][HouseLabel],0xFF0000FF,string);//Updating the label with a red color
        return 1;
    }
    SendClientMessage(playerid,-1,"You aren't near a house!");
    return 1;
}

COMMAND:sellhouse(playerid,params[])
{
    for(new i = 0; i < MAX_HOUSES;i++)//Loop threw all houses.
    {
        if(!IsPlayerInRangeOfPoint(playerid,8.0,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos])) continue;//Check if the player is near a house checkpoint
        if(HInfo[i][Owned] == 0) return SendClientMessage(playerid,-1,"This house isn't owned");//Checking if the house is already owned.
        new pName[24];
        GetPlayerName(playerid,pName,sizeof(pName));//Retrieving the player's name.
        if(HInfo[i][Owned] == 1 && strcmp(pName,HInfo[i][Owner]) != 0) return SendClientMessage(playerid,-1,"You aren't the owner of this house!");//Checking if the house is owned but the owners name is different
        HInfo[i][Owned] = 0;//Setting the house owned var to 1.
        new file[60],string[100];//Creating the necessary vars.
        format(HInfo[i][Owner],24,"Nonusablenameforthishouse");//Setting the House Owner's var
        format(file,sizeof(file),"RealityC/houses/%i.ini",i);//Formating the house file
        INI_Open(file);//Opening the house file
        INI_WriteInt("Owned",0);//Setting in the ini file "Owned" to 0
        INI_WriteString("Owner","Nonusablenameforthishouse");//Setting the "Owner" to the "Nonusablenameforthishouse".
        INI_Save();//Saving the ini
        INI_Close();//Closing the ini
        format(string,sizeof(string),"Owned: No \nPrice: %i \nOwner: None",HInfo[i][Price],pName);//Formating the string, so we can update the label of the house
        Update3DTextLabelText(HInfo[i][HouseLabel],0xFF0000FF,string);//Updating the label with a red color
        return 1;
    }
    SendClientMessage(playerid,-1,"You aren't near a house!");
    return 1;
}
//============================================OOC PLAYER CMDS================================================

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == FCSD)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 1)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, Police Car");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FCSD - Cops have been notified");
    }
}
if(vehicleid == FCSD1)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 1)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, Police Car");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FCSD - Cops have been notified");
    }
}
if(vehicleid == FCSD2)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 1)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, Police Car");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FCSD - Cops have been notified");
    }
}
if(vehicleid == FCSD3)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 1)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, Police Car");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FCSD - Cops have been notified");
    }
}
if(vehicleid == FCSD4)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 1)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, Police Car");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FCSD - Cops have been notified");
    }
}
if(vehicleid == FCSD5)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 1)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, Police Car");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FCSD - Cops have been notified");
    }
}
if(vehicleid == FBI1)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 2)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, FBI");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FBI - Cops have been notified");
    }
}

if(vehicleid == FBI2)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 2)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, FBI");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FBI - Cops have been notified");
    }
}

if(vehicleid == FBI3)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 2)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, FBI");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FBI - Cops have been notified");
    }
}

if(vehicleid == FBI4)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 2)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, FBI");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FBI - Cops have been notified");
    }
}

if(vehicleid == FBI5)//Checking if the vehicleid matches the FireCat one.
{
    new pName[MAX_PLAYER_NAME];//Where we will store the players name in a 24 size.
    GetPlayerName(playerid,pName,sizeof(pName));//Getting the players name and storing it in pName.
    if(PInfo[playerid][FACTION] == 2)//String compare between the users name and the selected name.
    {
        //If the 2 names are the same...
        SendClientMessage(playerid,-1,"You have entered, FBI");
    }
    else//Else if the 2 names don't match....
    {
        RemovePlayerFromVehicle(playerid);//Lets remove him from the vehicle
        SendClientMessage(playerid,-1,"This car belongs to FBI - Cops have been notified");
    }
}
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		if(Engine[vehicleid] == 0)
		{
			TogglePlayerControllable(playerid, 0);
			SendClientMessage(playerid, COLOR_YELLOW, "Press (Shift) or Type (/engine) to start the vehicles engine");
			}
				else if(Engine[vehicleid] == 1)
				{
					TogglePlayerControllable(playerid, 1);
					SendClientMessage(playerid, COLOR_GREEN, "Engine Running...");
			}
}
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	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)
{
	if(pickupid == DMV)
	{
	SendClientMessage(playerid, COLOR_RED,"DMV, building type /enter");
	return 1;
}

if (pickupid == MechJob)
{
	GameTextForPlayer(playerid,"Do /joinmech to be a Mechanic!",2000,5);
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == Mechanic)
{
	SendClientMessage(playerid, COLOR_RED,"Mechanic, building type /enter");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == Sheriff)
{
	SendClientMessage(playerid, COLOR_RED,"Sheriff, building type /enter");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == SheriffDuty)
{
	SendClientMessage(playerid, COLOR_RED,"You are at the duty point, do /duty");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == FBIDuty)
{
	SendClientMessage(playerid, COLOR_RED,"You are at the duty point, do /fbiduty");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == EMS)
{
	SendClientMessage(playerid, COLOR_RED,"EMS, building type /enter");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == DMV)
{
	SendClientMessage(playerid, COLOR_RED,"DMV, building type /enter");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == DMVLicense)
{
	SendClientMessage(playerid, COLOR_RED,"Type in /buylicense to recieve your license!");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
}

if (pickupid == city)
{
	SendClientMessage(playerid, COLOR_RED,"City Hall, building type /enter");
	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	return 1;
 	}
 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)
{
	new vehicleid = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(Engine[vehicleid] == 0)
            {
            	if(newkeys & KEY_SECONDARY_ATTACK)
             	{
           		RemovePlayerFromVehicle(playerid);
            	TogglePlayerControllable(playerid, 1);
            	}
            	else if(newkeys & KEY_JUMP)
            	{
            	SendClientMessage(playerid, COLOR_GREEN, "Engine Starting...");
             	SetTimerEx("EngineTimer", 2000, 0, "i", playerid);
             	}
           	}
        }
 	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayer30Mins(playerid)
{
    if(PInfo[playerid][JOB] >= 1 || PInfo[playerid][FACTION] >= 1)
	{
	    SendClientMessage(playerid, COLOR_GREY,"________JOB PAYDAY_____________");
	    SendClientMessage(playerid, COLOR_GREY,"For your hardwork you have recieved money!");
	    SendClientMessage(playerid, COLOR_GREY,"You have recieved 50 Dollars for your hardwork");
	    SendClientMessage(playerid, COLOR_GREY,"(Each 30 minutes you will recieve 50 dollars))");
	    GivePlayerMoney(playerid, 50);
	}
	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 == 1)
    {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return
		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registration", "Please insert your password for your account", "Register", "Leave");
        dini_Create(file);
        dini_IntSet(file, "Password", udb_hash(inputtext));
	    dini_IntSet(file,"Level",PInfo[playerid][LEVEL] = 0);
	    dini_IntSet(file,"Admin Level",PInfo[playerid][ADMINLEVEL] = 0);
	    dini_IntSet(file,"Wired",PInfo[playerid][WIRED] = 0);
	    dini_IntSet(file,"Jailed",PInfo[playerid][JAILED] = 0);
	    dini_IntSet(file,"Job",PInfo[playerid][JOB] = 0);
	    dini_IntSet(file,"Faction",PInfo[playerid][FACTION] = 0);
	    dini_IntSet(file,"Car",PInfo[playerid][CAR] = 0);
	    dini_IntSet(file,"Phone",PInfo[playerid][PHONE] = 0);
	    dini_IntSet(file,"Phonebook",PInfo[playerid][PHONEBOOK] = 0);
	    dini_IntSet(file,"Mask",PInfo[playerid][MASK] = 0);
	    dini_IntSet(file,"Condom",PInfo[playerid][CONDOM] = 0);
	    dini_IntSet(file,"Gun Skill",PInfo[playerid][GUNSKILL] = 0);
	    dini_IntSet(file,"Job Skill",PInfo[playerid][JOBSKILL] = 0);
	    dini_IntSet(file,"CarLic",PInfo[playerid][CARLIC] = 0);
	    dini_IntSet(file,"FlyLic",PInfo[playerid][FLYLIC] = 0);
	    dini_IntSet(file,"GunLic",PInfo[playerid][GUNLIC] = 0);
     	dini_IntSet(file,"Money",GetPlayerMoney(playerid = 0));
	    dini_IntSet(file,"CopRank",PInfo[playerid][COPRANK] = 0);
	    dini_IntSet(file,"FBIRank",PInfo[playerid][FBIRANK] = 0);
	    dini_IntSet(file,"FireRank",PInfo[playerid][FIRERANK] = 0);
        format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s, you have been auto logged in.", name, inputtext);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        PLogged[playerid] = 1;
    	}
 if (dialogid == 2)
    {
        new name[MAX_PLAYER_NAME], file[256];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "RealityC Roleplay", "Your account is already registered, please login", "Login", "Leave");
        new tmp;
        tmp = dini_Int(file, "Password");
        if(udb_hash(inputtext) != tmp) {
            SendClientMessage(playerid, COLOR_RED, "You have inserted an incorrect password");
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "RealityC Roleplay", "Your account is already registered, please login", "Login", "Leave");
        }
        else
        {
            PLogged[playerid] = 1;
            PInfo[playerid][LEVEL] = dini_Int(file, "Level");
            PInfo[playerid][ADMINLEVEL] = dini_Int(file, "Admin Level");
            PInfo[playerid][WIRED] = dini_Int(file, "Wired");
            PInfo[playerid][JAILED] = dini_Int(file, "Jailed");
            PInfo[playerid][JOB] = dini_Int(file, "Job");
			PInfo[playerid][FACTION] = dini_Int(file, "Faction");
            PInfo[playerid][CAR] = dini_Int(file, "Car");
            PInfo[playerid][PHONE] = dini_Int(file, "Phone");
            PInfo[playerid][PHONEBOOK] = dini_Int(file, "Phonebook");
            PInfo[playerid][MASK] = dini_Int(file, "Mask");
            PInfo[playerid][CONDOM] = dini_Int(file, "Condom");
            PInfo[playerid][GUNSKILL] = dini_Int(file, "Gun Skill");
            PInfo[playerid][JOBSKILL] = dini_Int(file, "Job Skill");
            PInfo[playerid][CARLIC] = dini_Int(file, "CarLic");
            PInfo[playerid][FLYLIC] = dini_Int(file, "FlyLic");
            PInfo[playerid][GUNLIC] = dini_Int(file, "GunLic");
            GetPlayerMoney(playerid = dini_Int(file, "Money"));
            PInfo[playerid][COPRANK] = dini_Int(file, "CopRank");
            PInfo[playerid][FBIRANK] = dini_Int(file, "FBIRank");
            PInfo[playerid][FIRERANK] = dini_Int(file, "FireRank");
            SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!");
        }
    }
        return 1;
}
    
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Reply


Messages In This Thread
[HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 06:48
Re: [HELP] My Tester Game mode (RealityC) - by milanosie - 20.02.2012, 07:02
Re: [HELP] My Tester Game mode (RealityC) - by doreto - 20.02.2012, 11:06
Re: [HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 12:27
Re: [HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 12:31
Re: [HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 12:34
Re: [HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 12:37
Re: [HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 12:39
Re: [HELP] My Tester Game mode (RealityC) - by Eiy Mard - 20.02.2012, 12:41

Forum Jump:


Users browsing this thread: 4 Guest(s)