SA-MP Forums Archive
Save name on connect - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Save name on connect (/showthread.php?tid=262320)



Save name on connect - Unknown123 - 17.06.2011

Nevermind, i fixed it

Solution

pawn Код:
#define PlayerName(%0)    pName[%0]

new pName[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(pName[playerid], 24, name);
    return 1;
}



Re: Save name on connect - [DDC]Delight - 17.06.2011

EDIT: I was wrong..


Re: Save name on connect - Unknown123 - 17.06.2011

no, i mean to save the name into "pName" i have seen someone do that to save CPU or something

i used this before
pawn Код:
stock PlayerName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
but someone told me that use more CPU and he said i could try save the name in "pName"