SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 25/02/2010, 04:36 AM   #1
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,076
Reputation: 406
Default [FS] KRace

[FS] KRace

Info: Well, this is a race script. I made it a little while ago and decided to release it =]. It is a bit buggy so please post bugs so it can be fixed.

Scripting: It's a pretty shoddy script but it works :P. It comes with a race I made called around LS. To add checkpoints you must use this format:
pawn Code:
CreateRace(RaceName[], RaceTimeout/*Will fail a player if not finished in this time (Time in Seconds)*/, vehicle = -1/*Required vehicle to start the race! (Optional)*/)
For adding checkpoints (THEY MUST BE IN THE ORDER OF THE RACE):
pawn Code:
AddRaceCheckpoint(RaceName[], Float:x, Float:y, Float:z)
I also made a little script to help you save checkpoints:
pawn Code:
#include <a_samp>
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(AddRaceCP, 9, cmdtext);
    return 0;
}

dcmd_AddRaceCP(playerid, params[])
{
     new string[120];
     if(!strlen(params)) return SendClientMessage(playerid, 0x00D300AA, "/AddRaceCP [RaceName]");
     new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    format(string, sizeof(string), "AddRaceCheckpoint(\"%s\", %f, %f, %f);\r\n", params, X, Y, Z);
    new File:Check = fopen("RaceCPS.txt", io_append);
    fwrite(Check, string);
    fclose(Check);
    return 1;
}

You can also make your own command to start the race by doing this:

pawn Code:
dcmd_Startrace(playerid, params[])
{
  if(!strval(params)) return //Player didn't type anything
  if(/*Admin varaible here*/ == 0) return //Admin level not high enough
  if(StartRace(params) == 0) return //The race name wasn't valid or there is currently a race running
  if(StartRace(params) == 1) return //The race was started!
  return 1;
}

Screenshots:





Download:
PWN + AMX
Pastebin
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.
[HiC]TheKiller is offline   Reply With Quote
Old 25/02/2010, 05:43 AM   #2
Jontay
Big Clucker
 
Join Date: Oct 2008
Posts: 102
Reputation: 0
Default Re: [FS] KRace

Great work but a release for those who do not wish to use dcmd?
Jontay is offline   Reply With Quote
Old 25/02/2010, 05:52 AM   #3
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,076
Reputation: 406
Default Re: [FS] KRace

Quote:
Originally Posted by Jonteh
Great work but a release for those who do not wish to use dcmd?
Do you mean just those commands or the whole script?
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.
[HiC]TheKiller is offline   Reply With Quote
Old 25/02/2010, 07:43 AM   #4
morris91
Big Clucker
 
morris91's Avatar
 
Join Date: Feb 2008
Location: London, England
Posts: 99
Reputation: 1
Default Re: [FS] KRace

I just made my own race using your script Killer. Its awesome. Well done on making this mate.
morris91 is offline   Reply With Quote
Old 25/02/2010, 09:10 AM   #5
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,076
Reputation: 406
Default Re: [FS] KRace

Quote:
Originally Posted by morris91
I just made my own race using your script Killer. Its awesome. Well done on making this mate.
No problem =].
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.
[HiC]TheKiller is offline   Reply With Quote
Old 25/02/2010, 10:09 AM   #6
Jontay
Big Clucker
 
Join Date: Oct 2008
Posts: 102
Reputation: 0
Default Re: [FS] KRace

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Jonteh
Great work but a release for those who do not wish to use dcmd?
Do you mean just those commands or the whole script?
The whole script.
Jontay is offline   Reply With Quote
Old 25/02/2010, 11:17 AM   #7
[03]Garsino
Guest
 
Posts: n/a
Default Re: [FS] KRace

Nice
  Reply With Quote
Old 25/02/2010, 02:59 PM   #8
»»»Hakam
Big Clucker
 
Join Date: Nov 2009
Posts: 116
Reputation: 0
Default Re: [FS] KRace

Any screenshots?

~Hakam.
»»»Hakam is offline   Reply With Quote
Old 25/02/2010, 03:32 PM   #9
AiVAMAN
Gangsta
 
AiVAMAN's Avatar
 
Join Date: Sep 2008
Location: Lietuva
Posts: 741
Reputation: 0
Default Re: [FS] KRace

Quote:
Originally Posted by »»» Hakam «««
Any screenshots?

~Hakam.
I don't think screenshots are needed for this. :/

P.S. Great work.
AiVAMAN is offline   Reply With Quote
Old 25/02/2010, 06:54 PM   #10
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 3,076
Reputation: 406
Default Re: [FS] KRace

Quote:
Originally Posted by Jonteh
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by Jonteh
Great work but a release for those who do not wish to use dcmd?
Do you mean just those commands or the whole script?
The whole script.
Um, the script isn't even in DCMD.

Quote:
Originally Posted by [03
Garsino ]
Nice
Thx.

Quote:
Originally Posted by »»» Hakam «««
Any screenshots?

~Hakam.
Posting them now.
__________________
People seem to enjoy negitive repping me for topics that I made in 2009.
Therefore, if you want to view my releases, you can go here.

Skype: TheKiller@dr.com
I do NOT script for cash. Add me on MSN if you need help with small issues.
[HiC]TheKiller is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 03:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.