|
Hey, can someone help me?
I want to know how i can convert HEX-colors to the codes used for color embedding. Thanks, Danny |
SendClientMessage(playerid, -1, "{FF0000}Hello!, {FFFFFF}I'm Danny! :)");
{FF0000} = Red
{FFFFFF} = White
I need a script for my server. When i player get 20 kills the next gamemode will be started. I really need this!
|
Hey
I need a script for my server. When i player get 20 kills the next gamemode will be started. I really need this! |
stock Kills[MAX_PLAYERS char];
#define Kills[%0] Kills{%0}
//OnPlayerDeath
if(killerid != INVALID_PLAYER_ID) {
if(++Kills[killerid] == 20) {
GameModeExit();
return true;
}
}
|
"When I player" ? Shouldnt that be "If a player" ?
pawn Код:
|
Sorry didn't notice the ''I'' instead of ''A''.
|
Hey, just wondering if someone can make this as I have no clue where to start:
Players loose 10 health every 20 seconds when they are in a certain area. Thanks in advance ![]() |
//OnGameModeInit
SetTimer("AreaCheck", 20 * 1000, true);
forward AreaCheck();
public AreaCheck()
{
for(new i, Float: health; i != MAX_PLAYERS; ++i) { //foreach if available
if(IsPlayerInRangeOfPoint(i, RADIUS, X, Y, Z)) { //insert radius and coords
//Checks if the player in in that circle
//You could use other function to
//Like IsPlayerInArea (checks if the player is in an axial sqaure)
//Or IsPlayerInPerimeter, checks if the player is in a perimeter
GetPlayerhealth(i, health);
SetPlayerHealth(i, health - 10);
}
}
}
|
I would like to know if there is a website or array with all the existing locations of sprunk machines / snack machines, if there is please send it to me.
Eternely thankful. |
|
Why not just put a check under OPKSC with an animation check to find out if their using a sprunk machine?
|
|
Why not just put a check under OPKSC with an animation check to find out if their using a sprunk machine?
|
|
There are also libraries specifically designed for making progress meters, it shouldn\'t be hard to use those.
And LarzI: How many times have I told you about floatsqroot? |
|
sorry if this is WAY off-topic or spam, but i just HAVE to know, what is it that you told him about floatsqroot? PLEASE ASWER! Also, sorry again if this is a bad reply... i just HAVE to know!!!!!!!
![]() |
// Credit below to TiMxD of SA-MP Forums and RaGEZONE Forums
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(pInfo[playerid][pLogged] != 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You havent Logged in yet!");
return 1;
}
GetPlayerName(playerid, pName, sizeof(pName));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /ooc [text]");
return 1;
}
if(OOC == 1)
{
format(string, sizeof(string), "(( %s: %s ))", pName, result);
SendClientMessageToAll(COLOR_WHITE,string);
format(string, sizeof(string), "[OOC] %s: %s",pName,result);
SaveOOC(string);
}
else
{
if(pAdmin[playerid] == 0)
{
SendClientMessage(playerid,COLOR_GREY,"* The OOC channel has been disabled!");
}
}
}
return 1;
}
if(strcmp(cmd, "/b", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(pInfo[playerid][pLogged] != 1)
{
SendClientMessage(playerid, COLOR_GREY, "* You havent logged in yet!");
return 1;
}
GetPlayerName(playerid, pName, sizeof(pName));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [Local OOC Chat]");
return 1;
}
format(string, sizeof(string), "(( %s: %s ))", pName, result);
ProxDetector(12.0, playerid, string,COLOR_CHAT4,COLOR_CHAT4,COLOR_CHAT4,COLOR_CHAT4,COLOR_CHAT4);
printf("%s", string);
}
return 1;
}
// Credit above to TiMxD of SA-MP Forums and RaGEZONE Forums
|
EDIT: Also, don't tell me to search. There are enough threads needing help. They trick me. Plus my friend already bought hosting (he isn't smart enough to know this actually takes time.)
|
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_ORANGE 0xF6970CAA
#defome COLOR_GREY 0xCECECEFF
#define COLOR_ME 0xB360FDFF
CMD:report(playerid, params[])
{
new id, message[112];
if(sscanf(params, "us[112]", id, message))
return SendClientMessage(playerid, COLOR_YELLOW, "SYNTAX: /report [nick/id] [message]");
if(id == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You specified an invalid player ID.");
new string[128];
if(strlen(message) > 40)
{
format(string, sizeof(string), "REPORT: Sent by %s(%d) against %s(%d).", GetName(playerid), playerid, GetName(id), id);
// I don't know what your function is for sending messages to admins, that would go here (send "string" as the message).
format(string, sizeof(string), "REPORT MESSAGE: %s", message);
// I don't know what your function is for sending messages to admins, that would go here (send "string" as the message).
}
else
{
format(string, sizeof(string), "REPORT: Sent by %s(%d) against %s(%d). Message: %s", GetName(playerid), playerid, GetName(id), id, message);
// I don't know what your function is for sending messages to admins, that would go here (send "string" as the message).
}
return 1;
}
CMD:whisper(playerid, params[])
{
new id, message[41];
if(sscanf(params, "us[41]", id, message))
return SendClientMessage(playerid, COLOR_YELLOW, "SYNTAX: /report [nick/id] [message]");
if(id == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You specified an invalid player ID.");
if(strlen(message) > 41)
return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your message cannot be longer than 41 characters.");
new string[128];
format(string, sizeof(string), "Whisper| %s says; %s", GetName(playerid), message);
SendClientMessage(id, COLOR_WHITE, string);
format(string, sizeof(string), "Whisper| %s sent to %s", message, GetName(id));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
CMD:me(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_YELLOW, "SYNTAX: /me [action]");
new string[128];
format(string, sizeof(string), "* %s %s", GetName(playerid), params);
SendNearbyMessage(playerid, COLOR_ME, string);
return 1;
}
CMD:do(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_YELLOW, "SYNTAX: /do [enviornment]");
new string[128];
format(string, sizeof(string), "%s (( %s ))", params, GetName(playerid));
SendNearbyMessage(playerid, COLOR_ME, string);
return 1;
}
CMD:ooc(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_YELLOW, "SYNTAX: /(o)oc [message]");
if(strlen(params) > 91)
return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your message cannot be longer than 91 characters.");
new string[128];
format(string, sizeof(string), "OOC| %s(%d): %s", GetName(playerid), playerid, params);
SendClientMessageToAll(COLOR_ORANGE, string);
return 1;
}
CMD:b(playerid, params[])
{
if(isnull(params))
return SendClientMessage(playerid, COLOR_YELLOW, "SYNTAX: /b [message]");
if(strlen(params) > 90)
return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Your message cannot be longer than 90 characters.");
new string[128];
format(string, sizeof(string), "(( %s(%d): %s ))", GetName(playerid), playerid, params);
SendNearbyMessage(playerid, COLOR_GREY, string);
return 1;
}
stock SendNearbyMessage(playerid, color, string[])
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, 20, Pos[0], Pos[1], Pos[2]))
SendClientMessage(i, color, string);
}
}
CMD:time(playerid, params[])
{
if (isnull(params)) return SendClientMessage(playerid, -1, "{C0C0C0}Usage: /time <time id>");
return SetPlayerTime(playerid, strval(params));
}
error 017: undefined symbol "isnull" warning 202: number of arguments does not match definition 1 Error.