SA-MP Forums Archive
Format() - Creating Dynamic Messages - 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: Format() - Creating Dynamic Messages (/showthread.php?tid=104604)



Format() - Creating Dynamic Messages - Fresh_X - 25.10.2009

===============Deleted========================

Im Sorry But This Is Too Simalar To Andre's And + I Don't Want To Get My Ass Banned By Dugi,Kye Or Any one because i love SA:MP so thats it.....


Re: Format() - Creating Dynamic Messages - Donny_k - 25.10.2009

You can use the string variable twice, no need to create the additional string as you can just:

pawn Code:
GetPlayerName....str....
format( str...."INFO: %s(ID: %i) has joined.", str....
This will save you 24 characters (98, 24 * 4).

Also this could cause issues if the string needs to be used more than once at the same time, small risk but could happen as it is global but aslong as it is formatted before it's used (each time) then there shouldn't be an issue unless I'm overlooking something.


Re: Format() - Creating Dynamic Messages - SpiderPork - 25.10.2009

Really good job copying this guide from Andre on SA-MP Market.


Re: Format() - Creating Dynamic Messages - Peter_Corneile - 25.10.2009

pawn Code:
public OnPlayerConnect(playerid)
{
  new PlayerName[MAX_PLAYER_NAME];
  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

  format(str, sizeof(str), "INFO: %s(ID: %i) has joined.", PlayerName, playerid);
  SendClientMessage(playerid, COLOR_RED, str);
  return true;
}
This should be better .. (MAX_PLAYER_NAME added)


Re: Format() - Creating Dynamic Messages - Fresh_X - 25.10.2009

I Didn't Copy it lol but thanks noting this is almost alike!


Re: Format() - Creating Dynamic Messages - Peter_Corneile - 25.10.2009

Quote:
Originally Posted by Fresh_X
I Didn't Copy it lol but thanks noting this is almost alike!
Yup its the same but just wanted to suggest xD


Re: Format() - Creating Dynamic Messages - Fresh_X - 25.10.2009

Its The Same for Real? Damn i didnt notice im going to edit this and upgrade it as people think this is Andre's even though this was my tutorial and no i don't use sa-mp market lol


Re: Format() - Creating Dynamic Messages - Peter_Corneile - 25.10.2009

Quote:
Originally Posted by Fresh_X
Its The Same for Real? Damn i didnt notice im going to edit this and upgrade it as people think this is Andre's even though this was my tutorial and no i don't use sa-mp market lol
idk what youre talking about


Re: Format() - Creating Dynamic Messages - Fresh_X - 25.10.2009

I Was Saying that This Post Looks Like Andre's (People Say) So Im Gonna Edit It ! Understand now?


Re: Format() - Creating Dynamic Messages - Peter_Corneile - 25.10.2009

Quote:
Originally Posted by Fresh_X
I Was Saying that This Post Looks Like Andre's (People Say) So Im Gonna Edit It ! Understand now?
Ahh yeah . Good Luck