Script Request Thread #5

Bump! Sorry for the double posting but time is of the essence.
Reply

Quote:
Originally Posted by TheDominator
View Post
Bump! Sorry for the double posting but time is of the essence.
Bumping like that is against the rules! I highly recommend against it.

As for your question, do you want the command to accept Hex colours or actual colour names?
Reply

Quote:
Originally Posted by [HLF]Southclaw
View Post
Bumping like that is against the rules! I highly recommend against it.

As for your question, do you want the command to accept Hex colours or actual colour names?
Yes am very sorry for what I did but am in a rush, Hex colours.
Reply

Quote:
Originally Posted by TheDominator
View Post
Yes am very sorry for what I did but am in a rush, Hex colours.
You can just use sscanf to extract two hex codes from text:

pawn Code:
new tmpColour1, tmpColour2;
sscanf(params, "xx", tmpColour1, tmpColour2);
Then you can just use those in your set vehicle colour (I forgot the name somehow...) function!
Reply

I wanna have a clue for creating (/aduty) command like I saw it on other servers with features such as..
an admin (/aduty) Goes on another account, and (/aname) to set a name up for being on‌duty = 1.
More Information:
When you (/aduty) - Exactly as if you are relogging from the server and logging in into your Alternative Account
This account works with statistics and that with another over that, your admin level will be set to ZERO.
Hopefully you understood what I exactly need.

My best Regards!
Reply

WaterWalk...
No Lag Shot \ Anti Lag SHOT.
=]
Reply

its big bug and i cant fix it
Reply

Add this anywhere in your script

new AdminDuty[MAX_PLAYERS];
Reply

Does anyone got thous police lights? Or some scripts that can be done in 0.3e?
Reply

Hello I want Make /warn command But i fail more than one time , so can any one help me and make me one ?
Reply

I really need help with one function that probably requires trigonometry:
Something like:
pawn Код:
GetRelativePosition( &Float:x, &Float:y, &Float:z, Float:angle, Float:offsetx, Float:offsety, Float:offsetz );
For example, based on the angle, if "offsetx" is 1, then X will be +1 meter to the right, if "offsety", is -3, then Y will be -3 meters to the left, no matter the direction.
Reply

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
Hello I want Make /warn command But i fail more than one time , so can any one help me and make me one ?
pawn Код:
#include <a_samp>
#include < zcmd >                                      
#include <  sscanf2 >

#define COLOR_GREEN 0x33AA33AA
#define RED 0xE60000AA

CMD:warn(playerid, params[])
{
    if (P_DATA[ playerid ][ P_Level ] < 3)return SendError( playerid, "You are not allowed to use this command"),SendReason( playerid, " Low level!");
    if (P_DATA[ playerid ][ P_Logged ] == 0)return SendError( playerid, "Please login to use this command!");
    if ( sscanf( params, "us", params[ 0 ],params[ 1 ]) )return SendUsage( playerid, "/warn <id> [reason]" );
    if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
    if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
    if( params[ 0 ] == playerid )return SendError( playerid, "Why would you want to warn yourself?Did you do something?");

    ++P_DATA[ params[ 0 ] ][ P_Warns ];
    if( P_DATA[ params[ 0 ] ][ P_Warns ] < P_MAX_WARNS)
    {
        FormMessageForAllEx(playerid,COLOR_RED, "Administrator %s has givin a warning to %s! [Warn:%d/%d] [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ),P_DATA[ params[ 0 ] ][ P_Warns ],P_MAX_WARNS,params[ 1 ]);
        FormMessage( params[ 0 ], COLOR_RED, "Administrator %s has warned you ! Dont make him to ban you [Warn:%d/%d] [Reason: %s]",PlayerName2( playerid ),P_DATA[ params[ 0 ] ][ P_Warns ],P_MAX_WARNS, params[ 1 ]);
        FormMessage( playerid, COLOR_GREEN, "You have warned %s! [Warn:%d/%d] [Reason: %s]",PlayerName2( params[ 0 ] ),P_DATA[ params[ 0 ] ][ P_Warns ],P_MAX_WARNS,params[ 1 ]);
    }
    else if( P_DATA[ params[ 0 ] ][ P_Warns ] == P_MAX_WARNS )
    {
        FormMessageForAllEx(params[ 0 ],COLOR_GREEN, "%s has been kicked by the system! [Reason: Exceeding Warnings]",PlayerName2( params[ 0 ] ));
        FormMessage( params[ 0 ], COLOR_GREEN, "You have been kicked by the system! [Reason: Exceeding Warnings]",0);
        Kick( params[ 0 ] );
    }
    return 1;
}
Reply

Hi! Can someone help me with a /robplayer command?? Just an example please,i don't know how to start.
Reply

Quote:
Originally Posted by calin1996
Посмотреть сообщение
Hi! Can someone help me with a /robplayer command?? Just an example please,i don't know how to start.
Код:
CMD:rob(playerid, params[])
{
    new string[128], pID;
    if(sscanf(params, "u", pID)) return SendClientMessage(playerid, -1, "Correct usage for command is: /rob playerid");
    
    new cash = GetPlayerMoney(pID);
    new Float:steal =  cash * 0.10;
    
    format(string, sizeof(string), "You have stolen %d from ID %i", floatround(steal), pID);
    SendClientMessage(playerid, -1, string);
    
    GivePlayerMoney(playerid, floatround(steal));
    return 1;
}
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
I really need help with one function that probably requires trigonometry:
Something like:
pawn Код:
GetRelativePosition( &Float:x, &Float:y, &Float:z, Float:angle, Float:offsetx, Float:offsety, Float:offsetz );
For example, based on the angle, if "offsetx" is 1, then X will be +1 meter to the right, if "offsety", is -3, then Y will be -3 meters to the left, no matter the direction.
Please!
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
Please!
Trigonometry is easy so I'm happy to help but I dont understand what your talking about :P from what you have said I recognise no triangle.
Reply

Quote:
Originally Posted by admantis
Посмотреть сообщение
Please!
pawn Код:
stock GetRelativePosition(& Float: X, & Float: Y, & Float: Z, Float: A, const Float: oX, const Float: oY, const Float: oZ) {
    new
        Float: cos = floatcos(A, degrees),
        Float: sin = floatsin(A, degrees)
    ;
    X += cos * oX - sin * oY;
    Y += sin * oX + cos * oY;
    Z += oZ;
}
Reply

ok For Example here is the gangzone
pawn Code:
new gangzone;
 
public OnGameModeInit()
{
    gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
    return 1;
}
 
public OnPlayerSpawn(playerid)
{
    if(IsPlayerAdmin(playerid)) GangZoneShowForAll(gangzone,COLOR_RED);
    return 1;
}
And here is the checkpoint
pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0);
    return 1;
}
 
public OnPlayerEnterCheckpoint(playerid)
{
    GivePlayerMoney(playerid, 5000);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
these are teams + colors

pawn Code:
#define TEAM_USA 1
#define TEAM_COLOR_USA COLOR_BLUE
#define TEAM_JAPAN 2
#define TEAM_COLOR_JAPAN COLOR_WHITE
#define TEAM_GERMANY 3
#define TEAM_COLOR_GERMANY COLOR_BROWN
#define TEAM_RUSSIA 4
#define TEAM_COLOR_RUSSIA COLOR_RED
#define TEAM_ENGLAND 5
#define TEAM_COLOR_ENGLAND COLOR_PLUM
#define TEAM_MEXICO 6
#define TEAM_COLOR_MEXICO COLOR_LIMEGREEN
#define TEAM_INDIA 7
#define TEAM_COLOR_INDIA COLOR_CORAL
#define TEAM_BRAZIL 8
#define TEAM_COLOR_BRAZIL COLOR_AQUA
#define TEAM_FRANCE 9
#define TEAM_COLOR_FRANCE COLOR_INDIGO
#define TEAM_INDONESIA 10
#define TEAM_COLOR_INDONESIA COLOR_BISQUE
now i want if some one comes in checkpoint and stays 30 secs and caps and and get 5 score + 5000 money and gangzone color =his team
Reply

/mask command please?
Reply

Quote:
Originally Posted by Evation
View Post
/mask command please?
Try this:
pawn Code:
#include <a_samp>

new fstr[128], bool:IsMasked[MAX_PLAYERS];

public OnFilterScriptInit() { return 1; }

public OnPlayerConnect(playerid)
{
    IsMasked[playerid] = false;
    return 1;
}

public OnPlayerText(playerid, text[])
{
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    if (IsMasked[playerid])
    {
        format(fstr, sizeof(fstr), "[Stranger] %s: %s", playername, text);
        SendClientMessageToAll(0xFFFFFFAA, fstr); // Change to ProxDetector or whatever if it's a RP script
        return 0;
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/mask", true))
    {
        if (IsMasked[playerid])
        {
            IsMasked[playerid] = false;
            SendClientMessage(playerid, 0xFFFFFFAA, "You have successfully taken off your mask.");
        }
        else
        {
            IsMasked[playerid] = true;
            SendClientMessage(playerid, 0xFFFFFFAA, "You have successfully put your mask.");
        }
        return 1;  
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)