19.05.2011, 21:37
(
Последний раз редактировалось seanny; 19.05.2011 в 22:24.
)
I have decided to make an RP GM from scratch and I would like a development team to helpme with things and also anyone that is interested please PM me and to everyone else, Please give your suggestions
Here is the features I will try to script have:
Dynamic Faction System - admins use /fcreate and then a box comes up and have a few options
1.faction Name
2.Type - 1.Police 2.Prison Guard 3.Army 4.Gang 5.Hitman 6.Fire Department 7.Medical Department 8.Taxi
3.Duty Point
4.Skins - Maximum of 15 ranks
5.Vehicles - Maximum of 15 Vehicles
6.Ranks - Set the rank names
7.Rank Numbers - Set the amount of ranks the department will use
Dynamic Housing system - Admins use /hcreate and get a box with the following options
1.Door entrance
2.Price
3.Interior
Dynamic Business System - Players use /setupbusiness and a box comes up
1.Entrance
2.Type
3.Interior
4.Entrance Fee
5.Price
/Contract command for level 12's - Level 12 is to avoid abuse from under level 12
Paycheck System - Players have to go to the Bank to collect a paycheck
Advanced Admin System - Admins are to have like 100+ commands like
/kick /ban /permban /ajail /goto /aprison /mute
Newbie chat channel - Just like the one from SA-RP,US-RP and NG-RP
/(n)ewbie /tognewb
and other Basic RP commands - like /b /o /me /do /animlist
Phone System - Players can use /call and then type the number for example: /call 911
Give your suggestions and PM me to join my development team and they will be put in the credits
Progress So far
Here is the features I will try to script have:
Dynamic Faction System - admins use /fcreate and then a box comes up and have a few options
1.faction Name
2.Type - 1.Police 2.Prison Guard 3.Army 4.Gang 5.Hitman 6.Fire Department 7.Medical Department 8.Taxi
3.Duty Point
4.Skins - Maximum of 15 ranks
5.Vehicles - Maximum of 15 Vehicles
6.Ranks - Set the rank names
7.Rank Numbers - Set the amount of ranks the department will use
Dynamic Housing system - Admins use /hcreate and get a box with the following options
1.Door entrance
2.Price
3.Interior
Dynamic Business System - Players use /setupbusiness and a box comes up
1.Entrance
2.Type
3.Interior
4.Entrance Fee
5.Price
/Contract command for level 12's - Level 12 is to avoid abuse from under level 12
Paycheck System - Players have to go to the Bank to collect a paycheck
Advanced Admin System - Admins are to have like 100+ commands like
/kick /ban /permban /ajail /goto /aprison /mute
Newbie chat channel - Just like the one from SA-RP,US-RP and NG-RP
/(n)ewbie /tognewb
and other Basic RP commands - like /b /o /me /do /animlist
Phone System - Players can use /call and then type the number for example: /call 911
Give your suggestions and PM me to join my development team and they will be put in the credits
Progress So far
Код:
// Super Cool Role Play
// Made By Sean_Mcelholm
// Steal my work and DIE! >:D
#pragma unused ret_memcpy
#else
#include <a_samp>
#include <dini>
#include <dudb>
#include <djson>
#include <zcmd>
new gPlayerLogged[MAX_PLAYERS]
#define SERVER_USER_FILE "scriptfiles/%s.ini"
#define COLOR_WHITE 0xFFFFFFFF
#define FACTIONS_FILE "Factions"
#define MAX_GROUPS
public PrepareFactionsFile(commandtype, name, skin1, skin2, skin3, skin4, skin5, skin6, Float:x, FLoat:y, Float:z,interior)
{
new loopstring[128], otherstring[128];
new i = 0;
while(i <= MAX_GROUPS)
{
i++;
format(loopstring, sizeof(loopstring),"Faction_%d",i);
format(otherstring, sizeof(otherstring),"Faction_%d/FactionName",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/CommandsType",i); djSetInt(FACTIONS_FILE,otherstring,commandtype,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank1",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank2",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank3",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank4",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank5",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank6",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank7",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank8",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank9",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank10",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank11",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank12",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank13",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank14",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank15",i); djSet(FACTIONS_FILE,otherstring,"None",true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin1",i); djSetInt(FACTIONS_FILE,otherstring,skin1,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin2",i); djSetInt(FACTIONS_FILE,otherstring,skin2,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin3",i); djSetInt(FACTIONS_FILE,otherstring,skin3,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin4",i); djSetInt(FACTIONS_FILE,otherstring,skin4,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin5",i); djSetInt(FACTIONS_FILE,otherstring,skin5,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin6",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin7",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin8",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin9",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true)
format(otherstring, sizeof(otherstring),"Faction_%d/Skin10",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin11",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin12",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin13",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin14",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin15",i); djSetInt(FACTIONS_FILE,otherstring,skin6,true);
format(otherstring, sizeof(otherstring),"Faction_%d/X",i); djSetFloat(FACTIONS_FILE,otherstring,x,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Y",i); djSetFloat(FACTIONS_FILE,otherstring,y,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Z",i); djSetFloat(FACTIONS_FILE,otherstring,z,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Interior",i); djSetInt(FACTIONS_FILE,otherstring,interior,true);
djCommit(FACTIONS_FILE);
LoadFactions();
}
}
public LoadFactions()
{
new string[128], otherstring[128];
new i = 0;
while(i <= MAX_GROUPS)
{
i++;
format(string, sizeof(string),"Faction_%d",i);
if(djIsSet(FACTIONS_FILE, string))
{
new factionname[128], rankname1[128],rankname2[128],rankname3[128],rankname4[128],rankname5[128],rankname6[128];
format(otherstring, sizeof(otherstring),"Faction_%d/FactionName",i); format(factionname,sizeof(factionname),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/CommandsType",i); FactionInfo[i][fCommandsType] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Rank1",i); format(rankname1,sizeof(rankname1),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank2",i); format(rankname2,sizeof(rankname2),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank3",i); format(rankname3,sizeof(rankname3),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank4",i); format(rankname4,sizeof(rankname4),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank5",i); format(rankname5,sizeof(rankname5),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank6",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank7",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank8",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank9",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank10",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank11",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank12",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank13",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank14",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Rank15",i); format(rankname6,sizeof(rankname6),"%s", dj(FACTIONS_FILE, otherstring));
format(otherstring, sizeof(otherstring),"Faction_%d/Skin1",i); FactionInfo[i][fSkin1] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin2",i); FactionInfo[i][fSkin2] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin3",i); FactionInfo[i][fSkin3] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin4",i); FactionInfo[i][fSkin4] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin5",i); FactionInfo[i][fSkin5] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin6",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring)
format(otherstring, sizeof(otherstring),"Faction_%d/Skin7",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin8",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin9",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin10",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin11",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin12",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin13",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin14",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Skin15",i); FactionInfo[i][fSkin6] = djInt(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/X",i); FactionInfo[i][fX] = djFloat(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Y",i); FactionInfo[i][fY] = djFloat(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Z",i); FactionInfo[i][fZ] = djFloat(FACTIONS_FILE, otherstring);
format(otherstring, sizeof(otherstring),"Faction_%d/Interior",i); FactionInfo[i][fInterior] = djInt(FACTIONS_FILE, otherstring);
FactionInfo[i][fFactionName] = factionname;
FactionInfo[i][fRank1] = rankname1;
FactionInfo[i][fRank2] = rankname2;
FactionInfo[i][fRank3] = rankname3;
FactionInfo[i][fRank4] = rankname4;
FactionInfo[i][fRank5] = rankname5;
FactionInfo[i][fRank6] = rankname6;
FactionInfo[i][fRank7] = rankname7;
FactionInfo[i][fRank8] = rankname8;
FactionInfo[i][fRank9] = rankname9;
FactionInfo[i][fRank10] = rankname10;
FactionInfo[i][fRank11] = rankname11;
FactionInfo[i][fRank12] = rankname12;
FactionInfo[i][fRank13] = rankname13;
FactionInfo[i][fRank14] = rankname14;
FactionInfo[i][fRank15] = rankname15;
}
}
return 1;
}
forward PrepareFactionsFile(commandtype, name, skin1, skin2, skin3, skin4, skin5, skin6, skin7, skin8, skin9, skin10, skin11, skin11, skin 12, skin13, skin14, skin15 Float:x, FLoat:y, Float:z,interior);
enum fInfo
{
fFactionName[128], //Faction Name
fCommandsType, //Type of commands. For example "1"
fRank1[128], // 1st rank name
fRank2[128], // 2nd rank name
fRank3[128], // 3rd rank name
fRank4[128], // 4th rank name
fRank5[128], // 5th rank name
fRank6[128], // 6th rank name
fRank7[128], // 7th rank name
fRank8[128], // 8th rank name
fRank9[128], // 9th rank name
fRank10[128], // 10th rank name
fSkin1, //1st skin
fSkin2, //2nd skin
fSkin3, //3rd skin
fSkin4, //4th skin
fSkin5, //5th skin
fSkin6, //6th skin
Float:fX, // X coordinate of faction spawn
Float:fY, // Y coordinate of faction spawn
Float:fZ, // Z coordinate of faction spawn
fInterior // Interior of faction spawn
}
new FactionInfo[MAX_GROUPS][fInfo];
COMMAND:fcreate(playerid, params[])
{
new cmd[128], string[128], otherstring[128], factionid;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "s", cmd) != 0)
{
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fcreate [name | commands | ranks | skins | spawn]");
}
if(strcmp("name", cmd, true, 4) == 0)
{
new name[128];
if(!sscanf(params, "sds", cmd, factionid, name))
{
if(factionid >= 1 && factionid <=20)
{
new str[128];
format(otherstring, sizeof(otherstring),"Faction_%d/FactionName",factionid); format(string, sizeof(string), "%s", name); djSet(FACTIONS_FILE,otherstring,string,true);
djCommit(FACTIONS_FILE);
format(str, sizeof(str), "Faction [%d] name set to %s", factionid, string);
SendClientMessage(playerid, COLOR_WHITE, str);
}
else return SendClientMessage(playerid, COLOR_WHITE, "Choose faction id between 1 and 20!");
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fcreate name <id> <name>");
}
if(strcmp("commands", cmd, true, 8) == 0)
{
new commandtype;
if(!sscanf(params, "sdd", cmd, factionid, commandtype))
{
new str[128];
format(otherstring, sizeof(otherstring),"Faction_%d/CommandsType",factionid); djSetInt(FACTIONS_FILE,otherstring,commandtype,true);
djCommit(FACTIONS_FILE);
format(str, sizeof(str), "You changed faction [%d] vommand type to [%d]", factionid, commandtype);
SendClientMessage(playerid, COLOR_WHITE, str);
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /afaction commands <id> <command type>");
}
if(strcmp("ranks", cmd, true, 5) == 0)
{
new rank, rankname[128];
if(!sscanf(params, "sdds", cmd, factionid, rank, rankname))
{
new str[128];
format(otherstring, sizeof(otherstring),"Faction_%d/Rank%d",factionid, rank); format(string, sizeof(string), "%s", rankname); djSet(FACTIONS_FILE,otherstring,string,true);
djCommit(FACTIONS_FILE);
format(str, sizeof(str), "faction id [%d] rank%d name set to %s.", factionid, rank, string);
SendClientMessage(playerid, COLOR_WHITE, str);
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fcreate ranks <id> <rank id> <rank name>");
}
if(strcmp("skins", cmd, true, 5) == 0)
{
new slotid, skinid;
if(!sscanf(params, "sddd", cmd, factionid, slotid, skinid))
{
new str[128];
format(otherstring, sizeof(otherstring),"Faction_%d/Skin%d",factionid, slotid); djSetInt(FACTIONS_FILE,otherstring,skinid,true);
djCommit(FACTIONS_FILE);
format(str, sizeof(str), "faction id [%d] skin%d set to %d", factionid, slotid, skinid);
SendClientMessage(playerid, COLOR_WHITE, str);
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fcreate skins <id> <slot id> <skinid>");
}
if(strcmp("spawn", cmd, true, 5) == 0)
{
if(!sscanf(params, "sd", cmd, factionid))
{
new str[128], Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format(otherstring, sizeof(otherstring),"Faction_%d/X",factionid); djSetFloat(FACTIONS_FILE,otherstring,x,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Y",factionid); djSetFloat(FACTIONS_FILE,otherstring,y,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Z",factionid); djSetFloat(FACTIONS_FILE,otherstring,z,true);
format(otherstring, sizeof(otherstring),"Faction_%d/Interior",factionid); djSetInt(FACTIONS_FILE,otherstring,GetPlayerInterior(playerid),true);
djCommit(FACTIONS_FILE);
format(str, sizeof(str), "You changed faction [%d] spawn to %f %f %f and %d interior.", factionid, x, y, z, GetPlayerInterior(playerid));
SendClientMessage(playerid, COLOR_WHITE, str);
}
else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /fcreate spawn <id>");
}
}
return 1;
}
main()
{
print("\n----------------------------------");
print(" Super Cool Role Play");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("SC-RP V1.0");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
if(!fexist(FACTIONS_FILE))
{
print("ERROR: No Factions File! Creating new one");
fcreate(FACTIONS_FILE);
new commandtype, name, skin1, skin2, skin3, skin4, skin5, skin6, Float:x, FLoat:y, Float:z,interior;
PrepareFactionsFile(commandtype, name, skin1, skin2, skin3, skin4, skin5, skin6, Float:x, FLoat:y, Float:z,interior);
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
gPlayerLogged[playerid] = 0;
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if (!dini_Exists(file))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Welcome to Super Cool Role Play, Please Type your Password below", "Register", "Leave");
}
if(fexist(file))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome to Super Cool Role Play, Please type your password below", "Login", "Leave");
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
{
dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
}
gPlayerLogged[playerid] = 0;
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
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)
{
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)
{
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)
{
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[])
{
return 1;
}
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, "Welcome to Super Cool Role Play", "Please Type your Password below", "Register", "Leave");
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(inputtext));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 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);
gPlayerLogged[playerid] = 1;
}
if (dialogid == 2)
{
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, 2, DIALOG_STYLE_INPUT, "Welcome to Super Cool Role Play", "Please Type your password below to Login", "Login", "Leave");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, COLOR_RED, "Wrong Password!");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome to Super Cool Role Play", "Please Type your password below to Login", "Login", "Leave");
}
else
{
gPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!");
}
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
enum pInfo
{
pAdminLevel,
pCash,
pScore,
}
new PlayerInfo[MAX_PLAYERS][pInfo];


