#define SCM SendClientMessage // You can use now SCM instead of SendClientMessage #define SPD ShowPlayerDialog // You can use SPD now instead of ShowPlayerDialog
// Before SendClientMessage(playerid, 0xFFFFFFFF, "Hello world , there it's a dude !"); // Send to player a message // After you can type like that (more easy) SCM(playerid, 0xFFFFFFFF, "Hello world, there it's a dude !"); // Send to player the same message
new String[2][128]; format(String[0], sizeof(String), "Message"); // format the string | sizeof(string) mean the cell size = 128 in our case format(String[1], sizeof(String), "Message2") // format another dimension of our string SCM(playerid, -1, String[0]); // Show player the content of String[0] ("Message") SCM(playerid, -1, String[1]); // Show player the content of String[1] ("Message2")
#include <a_samp> #define RED 0xFF0000FF // There FF it's the maximum of RED (From AA to FF or numbers from 00 to 99) - 0000 are green and blue and FF again represents Alpha (00 it's invisible) #define BLUE "0000FF" // There it's blue - You need to write it in "" because it's used in a string (For multi color texts) -- You can write it like that too - #define BLUE "{0000FF}" // On a public or somewhere you can use it SetPlayerColor(playerid, RED); // Put the player color to RED (On radar the player will have color red - in Score Tab too) // But you can use it like that SCM(playerid, 0xFF0000FF, "That message it's red !"); // You can put too 'RED' instead of 0xFF0000FF SCM(playerid, RED, "That message it's red defined !"); // There used RED SCM(playerid, RED, "There it's red {"BLUE"} and there it's blue !"); // There the message will print RED util where in text appear {"BLUE"} , there the text color will change to BLUE SCM(playerid, -1, "That it's white , "BLUE" there it's blue !"); // What ? What color it's -1 ? -1 mean white - you can write -1 instead of 0xFFFFFF | Why i used "BLUE" with out { } ? You can use "BLUE" without brackets if you defined it like that "{0000FF}" SCMF(playerid, -1, "The last message {0000FF} there it's blue !"); // {0000FF} mean "BLUE", ("BLUE" mean that HEX code , anyway..) , you can use it like that too !
~r~ red // Source SA:MP wiki ~g~ green // Source SA:MP wiki ~b~ blue // Source SA:MP wiki ~w~ white // Source SA:MP wiki ~y~ yellow // Source SA:MP wiki ~p~ purple // Source SA:MP wiki ~l~ black // Source SA:MP wiki ~h~ lighter color // Source SA:MP wiki
#include <a_samp>
new gString[256];
public OnPlayerSpawn(playerid)
{
format(gString, sizeof(gString), "You have spawned !");
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
format(gString, sizeof(gString), "You was killed !");
return 1;
}
stock GetName(playerid) { new pName[MAX_PLAYER_NAME]; // MAX_PLAYER_NAME = 24 and our string cell size GetPlayerName(playerid, pName, sizeof(String)); // Get the player name and stock it on pName return pName; // return successfully } // Use public OnPlayerDeath(playerid, killerid, reason) { new String[128]; // Create the string format(String, sizeof(String), "%s was killed by %s !", GetName(playerid), GetName(killerid)); // format our string SendClientMessageToAll(-1, String); // Show message to all return 1; }
#include <YSI\y_va> stock SendMessage(playerid, Color, Format[], va_args<>) // You will need y_va include { new String[148]; va_format(String, sizeof(String), Format, va_start<3>); SendClientMessage(playerid, Color, String); return 1; }
new String[string size]; format(String, sizeof(String), "Your id it's %i !", playerid); SendClientMessage(playerid, -1, String);
SendMessage(playerid, -1, "Your id it's %i !", playerid); // just it
stock FormatMoney(Number) // Show player money with "." between 3 numbers
{
new str[16];
format(str, 16, "$%i", Number);
new l = strlen(str);
if(Number < 0)
{
if (l > 5) strins(str, ".", l-3);
if (l > 8) strins(str, ".", l-6);
if (l > 11) strins(str, ".", l-9);
}
else
{
if (l > 4) strins(str, ".", l-3);
if (l > 7) strins(str, ".", l-6);
if (l > 10) strins(str, ".", l-9);
}
return str;
}
public OnPlayerSpawn(playerid) { SendMessage(playerid, -1, "You have {008000}%s{FFFFFF} !", FormatMoney(GetPlayerMoney(playerid))); return 1; }
public OnFilterScriptInit( ) { for(new i=0; i<300; i++) // That will loop i from 0 to 299 ( before it's just < not and = ) { AddPlayerClass(i, ....); // There will a classes from 0 to 299 } // So we have added 299 classes in 4 lines . return 1; }
// somewhere new count=0; for(new i=0; i<=GetPlayerPoolSize( ); i++) { if(IsPlayerConnected(i)) { IsPlayerAdmin(i)) count++; } } SendMessage(playerid, -1, "There are %i admins online !", count);
Specifier Meaning ____________________________ %i Integer (whole number) %d Integer (whole number). %s String %f Floating-point number (Float: tag) %c ASCII character %x Hexadecimal number %b Binary number %% Literal '%' %q Escape a text for SQLite. (Added in 0.3.7 R2)
#define SCM SendClientMessage // You can use now SCM instead of SendClientMessage
#define SPD ShowPlayerDialog // You can use SPD now instead of ShowPlayerDialog
new gString[256]; format(gString, sizeof(gString), "You have spawned !"); return 1;
for(new i=0; i<=GetPlayerPoolSize( ); i++) |
for(new i=GetPlayerPoolSize(); i!=-1; i--)
{
}