SA-MP Forums Archive
Script Request Thread #5 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Script Request Thread #5 (/showthread.php?tid=187229)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34


Re: Script Request Thread #5 - ivanVU - 20.11.2011

Thank you,you helped alot rep+


Re: Script Request Thread #5 - TheLonelyBeast - 20.11.2011

Dear, Everyone
I am looking for scripter Payment Will be Settle in a discussion And This script that i need to be made is a RP so
If you have experience in it and i am not talking about no Beginner (as in oh look i made a hello message) no i need advance and Other Information is private and will be discuss if you are Interested You can reach me on
thelonelybeast@hotmail.com

If you a php & html coder you are welcome to ad me two

Peace


Re: Script Request Thread #5 - Richie - 21.11.2011

I need some help with string in a dialog, i dont really know what to search for so i ask here
I want a dialog with different text, depending if a variable is true or false.
Like: ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Tog", "Join Msgs - On \nGlobal Chat - Off", "Tog", "Cancel");
When user clicks Tog join msgs the text will show "Join Msgs - Off" and the var joinmsgs[playerid] will be false.
How to create that?

Edit: Got it, if anyone else needs this, its in scripting discussion.


Re: Script Request Thread #5 - Unknown123 - 22.11.2011

i request a big xmas tree in lv (with presents 0.3c objects XmasBox1 - XmasBox5)


Re: Script Request Thread #5 - Butch - 22.11.2011

Heey guys
Im Butch ;p as u see
Well i have a question
Could u script maybe?

Well i want my Gangs have a color. when they
say something in ooc Can u maybe do that for me should be nice
like all gangs/faction have a color when they talk like my name in game is butch and im in Yamaguchi/o Butch: hello like that


add me on msn leroy_558@msn.com


Re: Script Request Thread #5 - andrewgrob - 22.11.2011

i want a smoke script and fire script for my new map .

its called omaha beach . its a ww2 map im making

anybody help

ill come back.. hmm question can i just place a smoke can object ?


Re: Script Request Thread #5 - andrewgrob - 23.11.2011

thats man ill try this today . really helps alot thank you


Re: Script Request Thread #5 - ivanVU - 23.11.2011

hi there,i wonna make rank for factions,but idk how..

where should I put this,if it goes like this..

Code:
if(PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMember] == 1)
{
if(PlayerInfo[playerid][pRank] == 1) { RankText = "Rokie"; }
else if(PlayerInfo[playerid][pRank] == 2) { RankText = "Captain"; }
}
else if(PlayerInfo[playerid][pLider] == 2 || PlayerInfo[playerid][pMember] == 2)
{
if(PlayerInfo[playerid][pRank] == 1) { RankText = "Gangsa"; }
else if(PlayerInfo[playerid][pRank] == 2) { RankText = "Capo"; }
}
so,where should i put this?

If this is not good then tell me how to do it please,thanks for any help


Re: Script Request Thread #5 - [MG]Dimi - 24.11.2011

PHP Code:
if(PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pMember] == 1)
{
    if(
PlayerInfo[playerid][pRank == 1RankText[playerid] = "Rokie";
    else if(
PlayerInfo[playerid][pRank] == 2RankText[playerid] = "Captain";
}
else if(
PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pMember] == 2)
{
    if(
PlayerInfo[playerid][pRank] == 1RankText[playerid] = "Gangsa";
    else if(
PlayerInfo[playerid][pRank] == 2RankText[playerid] = "Capo";

Now I would make it RankText[MAX_PLAYERS][54]. Then put this under OnPlayerConnect or where ever you load his stats. Next, once he gets promoted/demoted make sure you update RankText[playerid];


Re: Script Request Thread #5 - Max_Coldheart - 24.11.2011

Quote:
Originally Posted by '[HLF
pawn Code:
new const aRankNames[MAX_NUMBER_OF_RANKS][LONGEST_RANK_NAME_STRING_LENGTH]=
{
    "Newbie",
    "Next Rank",
    "Chuck Norris"
}

// Then return a rank name like this

printf("Rank 2: %s", aRankNames[2]); // Will print: "Rank 2: Chuck Norris"
Sorry for quoting you, but you could also tell him why it's returning "Chuck Norris", even though the "Next Rank" seems to be the second one. This is because in programming & scripting, the compiler starts variables from number 0. So basicly "Newbie" would be 0, "Next Rank" is 1, and "Chuck Norris" is 2. This is why it returns "Chuch Norris" instead of "Next Rank".


Re: Script Request Thread #5 - Max_Coldheart - 24.11.2011

Quote:
Originally Posted by [HLF]Southclaw
View Post
I forgot that, but seeing he is using enumerators and arrays etc I assumed he would be aware of this!
Originally I wrote Rank: 3 with the array cell as 2 but I thought that might be confusing (don't know why!)
Thanks for pointing that out
I just wanted him to know this if he didn't already know this, so he wont make any mistakes later on while working with enumerators and arrays :P


Re: Script Request Thread #5 - [L3th4l] - 25.11.2011

I'm in need of a "RemoveTags(Name[]);" function. Eg:
pawn Code:
[Test]Noob = Noob;
No[Test]ob = Noob;
Noob[Test] = Noob;
Thanks.
--
Also, if anyone can explain what "const" do, I've be very thankful!. I've seen that come up on this forums a lot lately. I did read the pawn_language.pdf but couldn't understand it / nor it showed a good example.

Thanks again.


Re: Script Request Thread #5 - KoczkaHUN - 25.11.2011

pawn Code:
stock RemoveTags(name[])
{
    new i, len = strlen(name), fpos = -1, lpos = -1;
    for (i = 0; i < len; i++)
    {
        if (name[i] == '[')
        {
            fpos = i;
        }
        else if (name[i] == ']')
        {
            lpos = i;
        }
    }

    if ( fpos == -1 || lpos == -1 ) return name;

    strdel(name, fpos, lpos);
    return name;
}



Re: Script Request Thread #5 - §с†¶e®РµРe - 25.11.2011

[SIZE = "7"]Scripting for money pm me here [/SIZE]


Re: Script Request Thread #5 - English-Conceptz - 25.11.2011

Hi guys and girls i have a request and hope someone can help, im still a noob around here so please try to give me more than an explanation, the code would be immense tbh.
Ok so i have this:

NOTE THIS ISNT PHP, I JUST USE THE TAGS TO COLOURS SHOW UP
PHP Code:
#include <a_samp>
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
new TruckerJob[256];
public 
OnFilterScriptInit()
{
    
AddStaticVehicle(403,2057.3081,-1939.9397,13.9432,270.4501,6,6); //  Truck (Spawn Front)
    
AddStaticVehicle(591,2045.2939,-1939.9041,13.0633,268.2366,6,6); //  Trailer (Spawn Back)
    
AddStaticVehicle(403,2032.4635,-1939.7537,13.9389,271.0817,6,6); //  Truck (Spawn Front)
    
AddStaticVehicle(591,2020.9797,-1940.1196,13.9476,270.5276,6,6); //  Trailer (Spawn Back)
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/job trucker"cmdtexttrue10) == 0)
    {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
        {
            if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))){ SendClientMessage(playerid,COLOR_RED,"* You don't have a trailer attached to the vehicle!"); return 1; }
            if(
TruckerJob[playerid] != && TruckerJob[playerid] != && TruckerJob[playerid] != 3){ TruckerJob[playerid] = 1; }
            new 
name[MAX_PLAYER_NAME], string[48];
            
GetPlayerName(playeridnamesizeof(name));
            
format(stringsizeof(string), "* %s is now a Trucker."name );
            
SendClientMessageToAll(COLOR_YELLOWstring);
    
// TRUCKER JOB #1
            
if(TruckerJob[playerid] == 1){
                
TruckerJob[playerid] = 2;
                
SetPlayerCheckpoint(playerid,1337.8055,-870.5533,39.3027,10);
                
SendClientMessage(playeridCOLOR_RED"Deliver food supplies to Roboi's Food Mart");
                return 
1;
            }
    
// TRUCKER JOB #2
            
if(TruckerJob[playerid] == 2){
                
TruckerJob[playerid] = 3;
                
SetPlayerCheckpoint(playerid,1003.4263,-941.8485,41.8079,10);
                return 
1;
            }
    
// TRUCKER JOB #3
            
if(TruckerJob[playerid] == 3){
                
TruckerJob[playerid] = 1;
                
SetPlayerCheckpoint(playerid,-97.8173,-1166.7585,2.2650,10);
                return 
1;
            }
            return 
1;
        }
        
SendClientMessage(playeridCOLOR_RED,"You have to be in a Truck cab to start the job");
    }
    return 
0;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
     {
         
SendClientMessage(playeridCOLOR_RED"* You can start Trucking by typing /job trucker");
     }
     return 
0;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
     if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
     {
        if(!
IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))){ SendClientMessage(playerid,COLOR_RED,"* You don't have a trailer attached to the vehicle!"); DisablePlayerCheckpoint(playerid); return 1; }
        
GivePlayerMoney(playerid,500);
        
SendClientMessage(playerid,COLOR_YELLOW,"* You have earned $500!");
        
DisablePlayerCheckpoint(playerid);
     }
     return 
1;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    if(
TruckerJob[playerid] > 0)
    {
        
SendClientMessage(playeridCOLOR_RED"* You have left your job, you won't be payed.");
        
DisablePlayerCheckpoint(playerid);
    }

#1
i want to do is re-organise the trucker jobs so that one is picked at random when "/job trucker" command is called. Im also going to add loads more jobs of course i just made 3 for now while ive been testing.

#2
i also need in somewhere when the trailer becomes disconnected during a mission, a client message comes up saying 'Re-connect trailer to continue with mission. Not doing so will result upon failure when checkpoint is reached' and then obviously if the player drives into the checkpoint with out the trailer he gets nothing.

#3 i want the player to go and re-stock supplies to from a warehouse to continue to make deliveries, after say between 5-7 trips (5-7 being picked at random after each time.

#4 i want each mission to flow into the next, at the moment the player has to type the command after each mission =/


Re: Script Request Thread #5 - English-Conceptz - 25.11.2011

Quote:
Originally Posted by ******
View Post
1) Look up "random()".

2) "IsTrailerAttachedToVehicle" will tell you if a vehicle has a trailer. To detect when it comes off you just need to call that function repeatedly, either in a timer or "OnPlayerUpdate".

3) Not sure.

4) Move the activiation code out of "OnPlayerCommandText" in to a new function then call that function from both "OnPlayerCommandText" with a random number to begin one, and from "OnPlayerEnterCheckpoint" with the next number to continue when they complete the current one.

I know it's not in-depth help, but hopefully useful pointers.
thanks for the reply im looking at the random function and im not going to lie i have no idea how to add it into what i already have lol, my friend basically wrote the skeleton of this then i used it and changed it a little but now im stuck. its a small script to so im hoping someone can just take a few mins of there time to help uber noob here out.


AW: Script Request Thread #5 - Dripac - 25.11.2011

//edit delete


Re: Script Request Thread #5 - Da' J' - 25.11.2011

I need a script addon which makes an "undercover police light" flash on any car's roof if their skin is 280. (GetPlayerSkin?)


Re: Script Request Thread #5 - demonarn - 26.11.2011

does anybody know how to make a force change team on dead part for like a zombie kills a human human changes in Zombie ?


snow weather - antonisrodos94 - 26.11.2011

hi all can you give me snow weather for christmas?