GetPlayerNameEx,SendClientMessageEx etc - 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: GetPlayerNameEx,SendClientMessageEx etc (
/showthread.php?tid=432811)
GetPlayerNameEx,SendClientMessageEx etc -
Necip - 24.04.2013
How could GetPlayerNameEx, SendClientMessageEx, ProxDetector be on a free gamemode I found without define and function and I can't use them on my new project?+REP to those who help me.
Re: GetPlayerNameEx,SendClientMessageEx etc -
Isolated - 24.04.2013
pawn Код:
stock GetPlayerNameEx(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
Re: GetPlayerNameEx,SendClientMessageEx etc -
Necip - 24.04.2013
Thanks +REPed but the other things?
Re: GetPlayerNameEx,SendClientMessageEx etc -
RVRP - 24.04.2013
Quote:
Originally Posted by Isolated
pawn Код:
stock GetPlayerNameEx(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); return name; }
|
If I'm not mistaken a stock function cannot return an array. Am I forgetting something?
Re: GetPlayerNameEx,SendClientMessageEx etc -
JaKe Elite - 24.04.2013
^
No.
I don't start scripting reading wikis.
But all i know. That name is not a array.
name[MAX_NAME]; is a string i guess ?
Re: GetPlayerNameEx,SendClientMessageEx etc -
SchurmanCQC - 24.04.2013
Quote:
Originally Posted by ******
Strings ARE arrays, but stocks can return both.
|
Yes. As long as the variable has a size (defined between the square brackets in the new statement) it is an array.
new arrayOne[
100];
for (
new i=0; i<
sizeof(arrayOne); i++)
{
arrayOne[i] = rand(10000);
}
That code will give every part of the array (from 0-100) a random value between 0 and 10,000.