Format() - Creating Dynamic Messages
#1

===============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.....
Reply
#2

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.
Reply
#3

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

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)
Reply
#5

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

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
Reply
#7

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
Reply
#8

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
Reply
#9

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)