[FilterScript] [FS] KRace
#1

[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 Код:
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 Код:
AddRaceCheckpoint(RaceName[], Float:x, Float:y, Float:z)
I also made a little script to help you save checkpoints:
pawn Код:
#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 Код:
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
Reply
#2

Great work but a release for those who do not wish to use dcmd?
Reply
#3

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?
Reply
#4

I just made my own race using your script Killer. Its awesome. Well done on making this mate.
Reply
#5

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 =].
Reply
#6

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.
Reply
#7

Nice
Reply
#8

Any screenshots?

~Hakam.
Reply
#9

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

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

P.S. Great work.
Reply
#10

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.
Reply
#11

~Waits for foxy to stroll on by~



Oh, on topic. Nice release :P
Reply
#12

Nice job, just what I needed!Thx!
Reply
#13

nice work
Reply
#14

i'll use this
Reply
#15

i think i gone put this in my server ^^
Reply
#16

Sorry for asking this silly question, but how do I start the race?
I have tried /startrace but it doesn't work.
Reply
#17

Nice one, i like the name of the FS.
Reply
#18

Can you please tell me the command to start the race?
Reply
#19

Quote:
Originally Posted by Cardinaal
Can you please tell me the command to start the race?
There's no command to start a race, it starts automatically in every 75 seconds.
Reply
#20

I have a problem.
When I join the race there are no cars.
And when I join my cars do not teleport with me.
I have a /carmenu script and when I spawn a vehicle, nothing appears.-
Help?
Reply


Forum Jump:


Users browsing this thread: 17 Guest(s)