#include <a_samp>
#pragma tabsize 0
#define FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x33CCFFAA
forward split(const strsrc[], strdest[][], delimiter);
new Menu:Property;
new Menu:Biz;
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" In-Game House Maker , By Jack_Sparr!");
print("--------------------------------------\n");
Biz = CreateMenu("Properties", 1, 50.0, 180.0, 200.0, 200.0);
SetMenuColumnHeader(Menu:Biz, 0, "Property");
AddMenuItem(Menu:Biz, 0, "Trailer");
AddMenuItem(Menu:Biz, 0, "Bedsit");
AddMenuItem(Menu:Biz, 0, "2 Room");
AddMenuItem(Menu:Biz, 0, "3 Room");
AddMenuItem(Menu:Biz, 0, "4 Room");
AddMenuItem(Menu:Biz, 0, "5 Room");
AddMenuItem(Menu:Biz, 0, "6 Room");
AddMenuItem(Menu:Biz, 0, "4 Room Luxury");
AddMenuItem(Menu:Biz, 0, "5 Room Luxury");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/biz", true) == 0)
{
TogglePlayerControllable(playerid, 0);
ShowMenuForPlayer(Menu:Biz, playerid);
return 1;
}
return 0;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
new entry[252];
new entry2[512];
if(CurrentMenu == Menu:Biz)
{
switch(row)
{
case 0:
{
new Float:X, Float:Y, Float:Z;
new File:hFile;
GetPlayerPos(playerid, X, Y, Z);
AddStaticPickup(1273, 2, X, Y, Z);
//format(entry, 250, "0|Nitko|Biznis|Nitko|%.2f|%.2f|%.2f|1.200000|-3.400000|999.400024|5|450000|50|0|1|3|0|50|50\n ", X, Y, Z);
format(entry, 250, "0,Nitko,Biznis,Nitko,%.2f,%.2f,%.2f,1.200000,-3.400000,999.400024,5,450000,50,0,1,3,0,50,50\n ", X, Y, Z);
hFile = fopen("biznis.cfg", io_append);
fwrite(hFile, entry2);
fclose(hFile);
HideMenuForPlayer(Menu:Property, playerid);
TogglePlayerControllable(playerid, 1);
}
case 1:
{
new Float:X, Float:Y, Float:Z;
new File:hFile;
GetPlayerPos(playerid, X, Y, Z);
AddStaticPickup(1273, 2, X, Y, Z);
format(entry, 250, "0|Nitko|Biznis|Nitko|%.2f|%.2f|%.2f|1.200000|-3.400000|999.400024|5|450000|50|0|1|3|0|50|50\n ", X, Y, Z);
//format(entry, 250, "0,Nitko,Biznis,Nitko,%.2f,%.2f,%.2f,1.200000,-3.400000,999.400024,5,450000,50,0,1,3,0,50,50\n ", X, Y, Z);
hFile = fopen("biznis.cfg", io_append);
fwrite(hFile, entry2);
fclose(hFile);
HideMenuForPlayer(Menu:Property, playerid);
TogglePlayerControllable(playerid, 1);
}
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
Originally Posted by cAMo
Why are you using menus instead of dialogs? Just wondering...
|
Originally Posted by cAMo
I just developed a business system using dynamic dialogs. Menus are outdated in my opinion
|
#include <a_samp>
#pragma tabsize 0
#define FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x33CCFFAA
forward split(const strsrc[], strdest[][], delimiter);
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/biznis", true) == 0)
{
ShowPlayerDialog(playerid,8000,DIALOG_STYLE_LIST,"BIZNIS","Napravi biz","DA", "NE");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new entry2[512];
if(dialogid == 8000)
{
switch(listitem)
{
case 0:
{
new Float:X, Float:Y, Float:Z;
new File:hFile;
GetPlayerPos(playerid, X, Y, Z);
AddStaticPickup(1273, 2, X, Y, Z);
//format(entry, 250, "0|Nitko|Biznis|Nitko|%.2f|%.2f|%.2f|1.200000|-3.400000|999.400024|5|450000|50|0|1|3|0|50|50\n ", X, Y, Z);
format(entry2, 250, "0,Nitko,Biznis,Nitko,%.2f,%.2f,%.2f,1.200000,-3.400000,999.400024,5,450000,50,0,1,3,0,50,50\n ", X, Y, Z);
hFile = fopen("biznis.cfg", io_append);
fwrite(hFile, entry2);
fclose(hFile);
TogglePlayerControllable(playerid, 1);
}
case 1:
{
new Float:X, Float:Y, Float:Z;
new File:hFile;
GetPlayerPos(playerid, X, Y, Z);
AddStaticPickup(1273, 2, X, Y, Z);
format(entry2, 250, "0|Nitko|Biznis|Nitko|%.2f|%.2f|%.2f|1.200000|-3.400000|999.400024|5|450000|50|0|1|3|0|50|50\n ", X, Y, Z);
//format(entry, 250, "0,Nitko,Biznis,Nitko,%.2f,%.2f,%.2f,1.200000,-3.400000,999.400024,5,450000,50,0,1,3,0,50,50\n ", X, Y, Z);
hFile = fopen("biznis.cfg", io_append);
fwrite(hFile, entry2);
fclose(hFile);
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}