Script Request Thread #5

Quote:
Originally Posted by -Danny-
Посмотреть сообщение
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
Hope that this will help you a bit.
Reply

Hey I need a script for my server. When i player get 20 kills the next gamemode will be started. I really need this!
Reply

Quote:
Originally Posted by Str4ndb3rg
Посмотреть сообщение
Hey I need a script for my server. When i player get 20 kills the next gamemode will be started. I really need this!
"When I player" ? Shouldnt that be "If a player" ?

pawn Код:
stock Kills[MAX_PLAYERS char];
#define Kills[%0] Kills{%0}

//OnPlayerDeath
    if(killerid != INVALID_PLAYER_ID) {
        if(++Kills[killerid] == 20) {
            GameModeExit();
            return true;
        }
    }
Reply

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
"When I player" ? Shouldnt that be "If a player" ?

pawn Код:
stock Kills[MAX_PLAYERS char];
#define Kills[%0] Kills{%0}

//OnPlayerDeath
    if(killerid != INVALID_PLAYER_ID) {
        if(++Kills[killerid] == 20) {
            GameModeExit();
            return true;
        }
    }
Oh thanks Sorry didn't notice the ''I'' instead of ''A''.
Reply

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
Reply

Quote:
Originally Posted by cloudysky
Посмотреть сообщение
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
pawn Код:
//OnGameModeInit
SetTimer("AreaCheck", 20 * 1000, true);
pawn Код:
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);
        }
    }
}
Read the comments
Reply

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

hello I need a cmd /giverespect with score saving in file... When player says /giverespect [id] then player gets +1 score and its saved in file. How to do it?
Reply

Hello pepz.

I need /grabgun [weapon name] and /takeammo [ammount] commands for arms/gun dealers,if someone got it or can make it please.

Thanks a lot!!
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
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?
Reply

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
Why not just put a check under OPKSC with an animation check to find out if their using a sprunk machine?
That is really a good idea which I didn't think of.
Thanks.
Reply

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
Why not just put a check under OPKSC with an animation check to find out if their using a sprunk machine?
please can you tell me exactly what animation is running when a player uses sprunk machine?

thanks
(off) if anyone wants to disable sprunks by ClearAnimations, I've got bad news: the animation doesn't play, but the player gets health and loses money. (/off)
Reply

My friend needs a list of 'AddStaticVehicles' all spread throught the desert, just like the cars at LVDM but this time arround the desert and small towns like El Quebrados, Las Payasadas etc.

Credits will be given.
Reply

Ok i need this so bad.

When a player does /search they can find a random skin, and then using dialog styles they can switch skin at any time?

Hope you understand what I mean

Sorry for bad english!
Reply

Quote:
Originally Posted by Y_Less
View Post
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!!!!!!!
Reply

Quote:
Originally Posted by sciman001
View Post
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!!!!!!!
You quoted a quite old post :/


I think he meant that the process to get a root is way more complex (takes longer) than a power of something


And as everyone know that the n-root of something is the power of the inverse (1/n), 2-root(x) = x^(1/2)


If you are intressted in all kind of stuff check this topic out
Reply

Yeah, I just need a few commands.

/report [ID] [REASON]
/engine [ON/OFF]
/truck [OPEN/CLOSE] - Not sure if that's possible?
/hood [OPEN/CLOSE] - Not sure if that's possible?
/whisper [ID] [MESSEGE]
/me
/rentcar
/exitcar

I already made a /ooc and /b about 6 months ago, just gotta get it from my old website.

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.)

EDIT2: About the /ooc and /b commands. I have it in the strcmp format. I need the zcmd version.


Код:
// 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
Reply

Quote:
Originally Posted by TiMxD
Посмотреть сообщение
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.)
You should still of searched. I did all of the commands except for the vehicle control commands (engine, windows, etc).

pawn Код:
#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);
    }
}
You will need the foreach, sscanf and ZCMD include files. This code is untested and therefore I make no guarantee that it will work properly. If you have any problems, let me know.
Reply

Thank you.
Reply

For some reason I'm getting an error from this code.
Код:
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.
And yes, I do have ZCMD included since my all commands are written for it.
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)