SA-MP Forums Archive
How to create commands /myrank - 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: How to create commands /myrank (/showthread.php?tid=135961)



How to create commands /myrank - Noredine - 22.03.2010

How to create commands /myrank

I have one server with ranking and i need commands /myrank for guy can see her rank


Re: How to create commands /myrank - Lajko1 - 22.03.2010

/myrank than just check what rank is a player and than just SendClientMessageToPlayer ...


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by Lajko1
/myrank than just check what rank is a player and than just SendClientMessageToPlayer ...
Yes i know , i need this commands


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by Noredine
Quote:
Originally Posted by Lajko1
/myrank than just check what rank is a player and than just SendClientMessageToPlayer ...
Yes i know , i need this commands
I have very need this commands


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
It's your script so only you know your variables

do you have a player info array?

if so use format then SendClient...
yes i have a player info array


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Then add the appropriate data in to the format [if you do not know how to use format tell me]
i do not know how to use the format


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Ok, format basically inserts data into text strings.
It is used like this:

format(string to format, length, "text with data types", data to insert);


Let me explain, for a message the string to format will be a new string so declare a new one: new str[[color=purple]60] now that is the string you are formatting.

Next is the length of the string, this should be the same as what is in the square brackets of the string declaration: [[color=purple]60] you have this as the amount of characters in the message plus 1 so if the sentence is 'I Like Pie' the number will be 10 as you start at 0 count to 9 then add 1 [the 1 is for an invisible character at the end of the string]

Then comes the text with data types, this is quite simple, you insert a data definition for where you want data to appear:

- %s is a string eg:

new str1[61], str2[4];
str2 = "not";
format(str1, 61, "this string is %s 61 characters", str2);


This will show up as "this string is not 61 characters" as %s is replaced by str2 that is declared earlier and assigned to the text 'not'


- %d or %i is an integer number eg:
"this string is not 61 characters"

This will show up as "this string is not 61 characters" again but this time the %d is replaced by the variable 'int1' because it is declared and assigned to the number 61


- %f is a floating point number eg:


new str1[61], Float:float1;
float1 = 61.57;
format(str1, 61, "this string is definitely not %f characters", float1);


This will show up as "this string is definitely not 61.57 characters" because %f is replaced by the variable 'float1' which is declared and assigned to the number 61.57


You can show multiple data types in a format by putting the data markers in the string in the same order as you add them into the function. eg:


new str1[61], str2[4], int1, int2, Float:float1;
str2 = "not";
int1 = 61;
int2 = 94;
float1 = 61.57;
format(str1, 61, "this string is definitely %s %f or %d characters long, it is actually %d characters long", str2, float1, int1, int2);


This will show up as "this string is definitely not 61.57 or 61 characters long, it is actually 94 characters long", all the variables are declared and assigned to their values and put into the string in the correct order.

Hope this helps you in strings and inserting values of data into text
Lol , i don't understand

If you can help me with TeamViewer , it's cool


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
What exactly is it that you don't understand?
All xD


Re: How to create commands /myrank - Noredine - 22.03.2010

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Read it through, I made it as simple as i could

Is it a language problem the best i can do then is translate in ****** xD
i translate this and don't understand ..


Re: How to create commands /myrank - 02manchestera - 22.03.2010

this is just another payer tring to make it and stealing my server name but adding a 2, where i ask the owners of Call of duty if i could use it i have the command and wil find it for you but im not very happy with what you have done but i kow there isnt much i can do.