SA-MP Forums Archive
Derby Questions(scripting) - 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: Derby Questions(scripting) (/showthread.php?tid=279516)



Derby Questions(scripting) - Admigo - 27.08.2011

Heey guys,
I want to have a look in the derby world so i have some questions about it:
Code:
Q1:Is it possible to make a pickup that change your car in other car(Same as mta pickup) And explain pls.
Code:
Q2:How can i make a vote system for choosing the derby track?
Code:
Q3:Is it possible to make change the damage what dealed to the cars?
Code:
Q4:How can i make a stopwatch so they can se how much seconds with milliseconds they survived?
Pls answer the Questions so i can go and make a derby server

Thanks admigo


Re: Derby Questions(scripting) - Admigo - 28.08.2011

Quote:
Originally Posted by 4ir-W4ys
View Post
Code:
Q1:Is it possible to make a pickup that change your car in other car(Same as mta pickup) And explain pls.
pawn Code:
public OnPlayerPickupPickUp(playerid, pickupid)
{
    if(pickupid == YOUR_PICKUP_ID)
    {
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleID(playerid) == MODELID)
        {
             DestroyVehicle(GetPlayerVehicleID(playerid));
             new Float:X,Float:Y,Float:Z,Float:A;
             new V;
             GetPlayerPos(playerid, X,Y,Z);
             GetPlayerFacingAngle(playerid, A);
             V = CreateVehicle(MODELID, X,Y,Z,A, COLOR1, COLOR2, -1);
             PutPlayerInVehicle(playerid, V);
             return 1;
        }
    }
    return 1;
}
Wasn't Tested, Change COLOR1, COLOR2, MODELID, and MODELID to what it need to be, unless you don't know how to script and Fuck off From Scripting Discussion NOW!
Whaha thanks dude,No i know how to script but i just want to know this:P


Re: Derby Questions(scripting) - BlackWolf120 - 28.08.2011

@4ir-W4ys: c'mon watch ur words dude! He wants to learn, well maybe he could have get smarter by using the search function first but lets be honest, we all used to be noobs having alot of questions and this forums is here to have the opportunity to ask questions! No need to get rude!

About the 3rd question:

You can set up a simple timer. Or didnt i get u ordinary?

pawn Code:
new countdown[MAX_PLAYERS];
new countdownkill[MAX_PLAYERS];

//OnPlayerConnect
countdown[playerid]=0;

//As soon as u put the player into the vehicle u can start the timer:
countdownkill[playerid] = SetTimerEx("counter",990,false,"i",playerid);

//somewhere else in ur script:

forward counter(playerid);
public counter(playerid)
{

if(countdown[playerid] > 0)
{

new string[45];
countdownkill[playerid] = SetTimerEx("counter",990,false,"i",playerid);
countdown[playerid] ++;
//in addition u can format the string and show the player for how long hes already active:
format(string, sizeof(string), "alive for: %d seconds!", countdown[playerid]);
GameTextForPlayer(playerid,string,1000,5);
//ofc u can also use texdraws or clientmessages to make a cool looking timer ;)
}
return 1;
}

//After death just reset the timer and let it start over again:

KillTimer(countdownkill[playerid]);
countdownkill[playerid]=-1;
countdown[playerid]=0;

countdownkill[playerid] = SetTimerEx("counter",990,false,"i",playerid);
Hope this helps

//edit: fixed some mistakes


Re: Derby Questions(scripting) - Admigo - 28.08.2011

Thanks dude only 2 questions left:P