Words in variable.
#1

Hey, guys. I'm creating E-mail system using GUI. It's uses 2 dialog's, one of them is for message, other one for the receiver. I want to save the message into variable, and then, after i put receiver name, i want to send him that message.
Is it possible to make it in other way, without .ini files?
Reply
#2

pawn Код:
new
    myArray[12];
myArray = "message";
pawn Код:
new
    myArray[12];
format(myArray, sizeof(myArray), "message");
Or do it like this if you want to use it per player:
pawn Код:
new
    myArray[MAX_PLAYERS][12];
myArray[playerid] = "message";
pawn Код:
new
    myArray[MAX_PLAYERS][12];
format(myArray[playerid], sizeof(myArray), "message");
Reply
#3

Thanks. But i think it didn't work.
Look, i make you a little example.

Код:
if(dialogid == 1) // To write sentence.
{
if(!response)
{
// Clearing up variable
return 1;
}
if(response)
{
MyVariable[playerid] = strlen(inputtext);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUTE,"E-mail","Write receiver","Send","Go back");
return 1;
}
}

if(dialogid == 2) // Write receiver and send message.
{
if(!response)
{
// Clearing up variable
return 1;
}
if(response)
{
SendClientMessage(receiverid,COLOR,"You have E-mail");
SendClientMessage(receiverid,COLOR,MyVariable[playerid]);
return 1;
}
}
I want something like this. :>
Reply
#4

(You need to create a string OR) just new bla[MAX_PLAYERS][256]; then somewhere before using it format(bla[playerid], 256, "BlaBlaBla"); and then do SendClientMessage... i think it's the best way (except the 256, try to make the size as small as possible).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)