09.04.2013, 14:50
Hello!
So, I was writing a new include that has a function that uses getarg() to get array/string passed by a player, but the problem is only first letters are being showed, e.g. in player messages! Example code:
And if I do ... :
... only letter "H" shows in message!
I saw that there's an optional parameter named "index", tried changing it so it wouldn't be 0, but then nothing shows!
Now, I'm using way more arrays and arguments, but I hope someone can clear this out for me on this simple example!
Thanks in advance!
Regards!
So, I was writing a new include that has a function that uses getarg() to get array/string passed by a player, but the problem is only first letters are being showed, e.g. in player messages! Example code:
pawn Код:
stock myfunc(...)
{
new msg[100];
format(msg,sizeof(msg),"%s",getarg(0)); //to avoid error 008: must be a constant expression
SendClientMessageToAll(-1,msg);
return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
myfunc("Hello and welcome!");
return 1;
}
I saw that there's an optional parameter named "index", tried changing it so it wouldn't be 0, but then nothing shows!
Now, I'm using way more arrays and arguments, but I hope someone can clear this out for me on this simple example!
Thanks in advance!
Regards!