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", "");
}
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", "");
}
File: fHandle = fopen("houses.cfg", io_write);
im actually not sure but heres a ling of code
pawn Код:
|