Things to make my script more efficient
#9

Use a stock to get players name:

pawn Код:
stock pName(playerid)
{
  new name[24];
  GetPlayerName(playerid, name, 24));
  return name;
}
Then, in a command or something which gets a players name, instead of doing:

pawn Код:
if(!strcmp(cmdtext, "/hello", true, 4))
{
    new string[128], name[24];
   
    GetPlayerName(playerid,name,24);
   
    format(string,128,"Hello %s !",name);
    SendClientMessage(playerid,-1,string);
}
You could do:

pawn Код:
if(!strcmp(cmdtext, "/hello", true, 4))
{
    new string[128];

    format(string,128,"Hello %s !",pName);
    SendClientMessage(playerid,-1,string);
}
Reply


Messages In This Thread
Things to make my script more efficient - by Luis- - 10.12.2011, 23:01
Re: Things to make my script more efficient - by Phanto90 - 10.12.2011, 23:26
Re: Things to make my script more efficient - by Luis- - 10.12.2011, 23:27
Re: Things to make my script more efficient - by Luis- - 11.12.2011, 12:20
Re: Things to make my script more efficient - by THE_KNOWN - 11.12.2011, 12:26
Re: Things to make my script more efficient - by Finn - 11.12.2011, 12:46
Re: Things to make my script more efficient - by PlayHard - 11.12.2011, 12:52
Re: Things to make my script more efficient - by Finn - 11.12.2011, 13:17
Re: Things to make my script more efficient - by grand.Theft.Otto - 11.12.2011, 15:24

Forum Jump:


Users browsing this thread: 2 Guest(s)