Script Request Thread #6
#61

i need a anti-airbreak like dis:
Warning:Test is useing airbreak
+

/giveallweapon
/giveweapon
Reply
#62

Quote:
Originally Posted by thegreathom
View Post
I said 0.3e Object Editor..
Reply
#63

deleted
Reply
#64

Quote:
Originally Posted by Lauder
View Post
hoo ok and for the GetAdminName thing, you mean this >
pawn Code:
#Define GetAdminName
no, put this on the bottom of the script....
Code:
stock GetAdminName(playerid)
{
	new adminname[128];
	switch(PlayerInfo[playerid][AdminLevel])
	{
		case 0: adminname = "0";
		case 1: adminname = "Moderator";
		case 2: adminname = "Administrator";
		case 3: adminname = "Management";
		case 4: adminname = "Owner";
	}
	return adminname;
}
Reply
#65

Hmmm.

Can anyone make me a hunger bar using the progress bar system?
I want it to decrease every 15 seconds.
Reply
#66

i need a /tow command for all players to use
Reply
#67

Quote:
Originally Posted by art123
View Post
no, put this on the bottom of the script....
Code:
stock GetAdminName(playerid)
{
	new adminname[128];
	switch(PlayerInfo[playerid][AdminLevel])
	{
		case 0: adminname = "0";
		case 1: adminname = "Moderator";
		case 2: adminname = "Administrator";
		case 3: adminname = "Management";
		case 4: adminname = "Owner";
	}
	return adminname;
}
Got it! if doesn't work i'll let you know. (Wait for you +rep )

EDIT: I tested the command with my own ID and didn't show the names just the reason. It looked like this >
Code:
  has kicked . Reason: testing the command
It happens because is with my self? Would it work fine with someone else ID?
Reply
#68

deleted.
Reply
#69

Quote:
Originally Posted by Lauder
View Post
Got it! if doesn't work i'll let you know. (Wait for you +rep )

EDIT: I tested the command with my own ID and didn't show the names just the reason. It looked like this >
Code:
  has kicked . Reason: testing the command
It happens because is with my self? Would it work fine with someone else ID?
It's because your PlayerName stock it's wrong scripted, try using this one...
Code:
stock PlayerName(playerid)
{
	new CName[24];
	GetPlayerName(playerid, CName, 24);
 	return CName;
}
Obviously have to replace this one with the one you already have, otherwise you'll get errors.
Reply
#70

Can someone make this?

http://www.part.lt/perziura/61801429...d34cb07860.png
This board show current speed
Reply
#71

Quote:
Originally Posted by Louris
View Post
Can someone make this?

http://www.part.lt/perziura/61801429...d34cb07860.png
This board show current speed
Waiting 3 days..
Reply
#72

Quote:
Originally Posted by Mr.Dexter
View Post
i need a /tow command for all players to use
pawn Code:
if(!strcmp(tmp, "/tow", true))
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new vehid = GetPlayerVehicleID(playerid);
        if(IsTrailerAttachedToVehicle(vehid))
        {
            DetachTrailerFromVehicle(vehid);
        }
        else
        {
            new Float:pX,Float:pY,Float:ppZ;
            GetPlayerPos(playerid,pX,pY,ppZ);
            new Float:vX,Float:vY,Float:vZ;
            new Found=0;
            new vid=0;
            while((vid<MAX_VEHICLES)&&(!Found))
            {
                vid++;
                    GetVehiclePos(vid,vX,vY,vZ);
                if((floatabs(pX-vX) < 7.0) && (floatabs(pY-vY) < 7.0)&& (floatabs(ppZ-vZ) < 7.0) && (vid != vehid))
                {
                    Found=1;
                    AttachTrailerToVehicle(vid, vehid);
                }
              }
        }
        if(!Found)
        {
            SendClientMessage(playerid, COLOR_RED2, "<!> "COL_WHITE"There is no car in range.");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid,  COLOR_RED2, "<!> "COL_WHITE"You must be in a vehicle to do this.");
        return 1;
    }
    return 1;
}
Reply
#73

I would like to know how to fix this:

pawn Code:
public OnPlayerText(playerid, text[])
{
    new finalstr[128+MAX_PLAYER_NAME], str3[3];
    format(finalstr, sizeof(finalstr), "%s", text);
    new startpos = strfind(finalstr, "id", true), len=0;
    if(startpos != -1)
    {
        for(new i=0;i<3;i++) if(finalstr[startpos+2+i] >= 48 && finalstr[startpos+2+i] <= 57) len++; else break;
        if(len > 0)
        {
            strmid(str3, finalstr, startpos+2, startpos+2+len);
            if(IsPlayerConnected(strval(str3)))
            {
                new temp[5];
                format(temp, 5, "id%s", str3);
                strreplace(finalstr, temp, PlayerName(strval(str3)));
                SendClientMessageToAll(0xffffffff, finalstr);
            }
            else SendClientMessageToAll(0xffffffff, text);
        }
        else SendClientMessageToAll(0xffffffff, text);
    }
    else SendClientMessageToAll(0xffffffff, text);
    return 0;
}

stock PlayerName(playerid)
{
  new name[MAX_PLAYER_NAME];
  GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  return name;
}

stock strreplace(string[], const search[], const replacement[], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof(string)) {
    // No need to do anything if the limit is 0.
    if (limit == 0)
        return 0;

    new
             sublen = strlen(search),
             replen = strlen(replacement),
        bool:packed = ispacked(string),
             maxlen = maxlength,
             len = strlen(string),
             count = 0
    ;


    // "maxlen" holds the max string length (not to be confused with "maxlength", which holds the max. array size).
    // Since packed strings hold 4 characters per array slot, we multiply "maxlen" by 4.
    if (packed)
        maxlen *= 4;

    // If the length of the substring is 0, we have nothing to look for..
    if (!sublen)
        return 0;

    // In this line we both assign the return value from "strfind" to "pos" then check if it's -1.
    while (-1 != (pos = strfind(string, search, ignorecase, pos))) {
        // Delete the string we found
        strdel(string, pos, pos + sublen);

        len -= sublen;

        // If there's anything to put as replacement, insert it. Make sure there's enough room first.
        if (replen && len + replen < maxlen) {
            strins(string, replacement, pos, maxlength);

            pos += replen;
            len += replen;
        }

        // Is there a limit of number of replacements, if so, did we break it?
        if (limit != -1 && ++count >= limit)
            break;
    }

    return count;
}
I get this errors:

Code:
.pwn(2025) : error 025: function heading differs from prototype
.pwn(2025) : error 025: function heading differs from prototype
.pwn(2025) : error 025: function heading differs from prototype
.pwn(2025) : fatal error 107: too many error messages on one line
At this line:

pawn Code:
stock strreplace(string[], const search[], const replacement[], bool:ignorecase = false, pos = 0, limit = -1, maxlength = sizeof(string)) {
Reply
#74

Can someone make /color command FS like

/color R G B ?
Reply
#75

I'm not entirely sure if it works, but try this:

pawn Код:
CMD:color(playerid, params[])
{
    new
        iR,
        iG,
        iB
    ;
    if( sscanf( params, "iii", iR, iG, iB ))
        return SendClientMessage( playerid, 0xFFFF00AA, "[USAGE] {FFFFFF}/color [Red] [Blue] [Green] (Values 0 - 255)" );
    if(( 256 <= iR <= -1 ) || ( 256 <= iG <= -1 ) || ( 256 <= iB <= -1 ))
        return SendClientMessage( playerid, 0xFFFF00AA, "[USAGE] {FFFFFF}/color [Red] [Blue] [Green] (Values 0 - 255)" );

    iR &= (( 0xFF << 16 ) | (( iG & 0xFF ) << 8 ) | ( iB & 0xFF ));
    SetPlayerColor( playerid, iR );

    return true;
}
Reply
#76

Someone check my request in the previous page, thanks.
Reply
#77

Missed a comma on the previous line

pawn Код:
szMessage[ 128 ], // We need another string to be able to fit the name and ID of the reporter,
            szName[ MAX_PLAYER_NAME + 1 ]
Reply
#78

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Missed a comma on the previous line

pawn Код:
szMessage[ 128 ], // We need another string to be able to fit the name and ID of the reporter,
            szName[ MAX_PLAYER_NAME + 1 ]
lol and I didn't notice that :P well thanks anyways! +REP

EDIT:
it doesn't work for MySQL, the server closes when ever someone uses the cmd.
Reply
#79

Need a CMD, pm me!
Reply
#80

Quote:
Originally Posted by art123
Посмотреть сообщение
lol and I didn't notice that :P well thanks anyways! +REP

EDIT:
it doesn't work for MySQL, the server closes when ever someone uses the cmd.
Hmm, I'm not entirely sure why.. I probably did something bad somewhere; check it with crashdetect!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)