SA-MP Forums Archive
Paying for this to be done - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Paying for this to be done (/showthread.php?tid=370769)



Paying for this to be done - NinjaChicken - 21.08.2012

ok i want a thing made so i say /setnotice WRITINGGOESHERE and then it saves to a .cfg file in my scriptfiles and when a player connects it check if the notice is set then shows it up in a dialog on there screen and they have a button to dismiss it but if i dont want the box to show i type /setnotice 0 and then it doesnt show when a player conencts please help


Re: Paying for this to be done - Ranama - 21.08.2012

If you know how you want to save it, just do like:

pawn Код:
new startnote[126];

//do a command just like normally then set this function in there.
new writethisnow[126];//sscanf or something to detect and save what the player writes after the command part.
format(startnote, sizeof(startnote), "%s", writethisnow);

//and on player connect just use
if(strval(startnote) != 0){
ShowPlayerDialog(playerid, 18273, DIALOG_STYLE_MSGBOX, "Important notice", startnote, "Dissmiss", "");
}
Hope it helped


Re: Paying for this to be done - NinjaChicken - 21.08.2012

thats a start but can you please do a step by step tut on it im confused already haha


Re: Paying for this to be done - Ranama - 21.08.2012

I'll try xD:

pawn Код:
new startnote[126];//start with doing a global variable to store the string you want the players to get when logged in.

//do a command just like normally then set this function in there.
YCMD:setloginmessage(playerid, params[], help){
    new message[126];//sscanf or something to detect and save what the player writes after the command part.
    if (help)return SendClientMessage(playerid, COLOR_HELP, "Use this command to set the login message");//this is just a thing you are using in YCMD, if you are not using YCMD skip this.
    if(sscanf(params, "s[126]", message))return SendClientMessage(playerid, COLOR_ERROR, "Usage: /setloginmessage [text] (0 if you don't want any login message)");//this is used to get the thing that the player typed after /setloginmessage
    format(startnote, sizeof(startnote), "%s", message);//here you just set the local variable to the same as the one you typed
    SendClientMessage(playerid, -1, "You have changed the login message to:");//only used to send a message that they have succeded made the command
    SendClientMessage(playerid, -1, startnotice);//this will send them the current login message

//and on player connect just use
if(strval(startnote) != 0){
ShowPlayerDialog(playerid, 18273, DIALOG_STYLE_MSGBOX, "Important notice", startnote, "Dissmiss", "");
}
Hope you understans taht a little better :S


Re: Paying for this to be done - NinjaChicken - 21.08.2012

still confusing the shit out of me haha im using ZCMD can you basically make the hole thing for me <3?


Re: Paying for this to be done - NinjaChicken - 21.08.2012

anyone


Re: Paying for this to be done - Shetch - 21.08.2012

What file saving system are you using?


Re: Paying for this to be done - NinjaChicken - 21.08.2012

im actually not sure but heres a ling of code

pawn Код:
File: fHandle = fopen("houses.cfg", io_write);



Re: Paying for this to be done - Shetch - 21.08.2012

I suggest that you use a file saving system like y_ini, but whatever.
I'm gonna try and create this for you.


Re: Paying for this to be done - ThePhenix - 21.08.2012

Quote:
Originally Posted by NinjaChicken
Посмотреть сообщение
im actually not sure but heres a ling of code

pawn Код:
File: fHandle = fopen("houses.cfg", io_write);
"Houses.cfg? I guess a file called Users.ini