05.03.2012, 13:53
(
Последний раз редактировалось iPLEOMAX; 07.03.2012 в 16:18.
)
returnf
For the above image, the code looks like:
Download:
Pastebin - RAW
Mediafire
Changelog:
How to Use:
This will replace the string's #developer# to "Kalcor".
If you use it in Commands/Text, same thing will happen.
Legal:
Mozilla Public License 2.0
Don't release any other version without my permission.
Bugs:
Report if you find any.
For the above image, the code looks like:
pawn Код:
RET:time()
{
new hr, mn, sc;
gettime(hr, mn, sc);
RETF("%i:%i", hr, mn);
}
RET:myscore(playerid)
{
RETF("%i", GetPlayerScore(playerid));
}
RET:randomcar() RETF("%s", aVehicleNames[random(sizeof aVehicleNames)]);
RET:dice() RETF("%i", random(6)+1);
RET:toss() RETF("%s", (random(2)) ? ("Head") : ("Tail"));
public OnPlayerText(playerid, text[])
{
returnf(text, playerid);
//There could be a bug due to the string lengths..
//If you type a text that is 30 characters,
//and the format returns something bigger than 30,
//The returned result will get trimmed.
//Best would be to format it into a longer string (create a new one).
return true;
}
Pastebin - RAW
Mediafire
Changelog:
Код:
* 5/Mar/2012: Initial Release. * 6/Mar/2012: Minor Fix + Removed useless debug part of the code. Modified the RETF function, you can use floats/ints/strings etc.
pawn Код:
//Create a new return function:
RET:developer()
{
RETF("%s", "Kalcor");
}
//Now, use
returnf("Haha, this is something cool. Creator of SA-MP: #developer#");
If you use it in Commands/Text, same thing will happen.
Legal:
Mozilla Public License 2.0
Don't release any other version without my permission.
Bugs:
Report if you find any.