SA-MP Forums Archive
Need help with points and money - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with points and money (/showthread.php?tid=152324)



Need help with points and money - BaFTa - 03.06.2010

Guys, I started to make a [FS] which gives you points and money when you drift. I was wondering how can I make it so when you make a longer drift it gives more points and money.

I have another question too. Where is my error? I deleted everything from the file and started building it again. Is this the problem?
Quote:

D:\Games\GTA San Andreas\MyServer\filterscripts\BaFTa`s [FS].pwn(17) : error 021: symbol already defined: "GetPlayerFacingAngle"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.

pawn Код:
#include <a_samp>

#define COLOR_RED 0xCC0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFFC0CBAA

public OnPlayerCommandText (playerid, cmdtext[])

if (strcmp(cmdtext, "/drift", true) == 0)

GetPlayerVehicleID(playerid);
GetPlayerFacingAngle(playerid, Float:20);
SetPlayerScore(playerid, 1);
GivePlayerMoney(playerid, 200);
I tryed with "else" but it didn`t work again. I`m a new scripter..


Re: Need help with points and money - FUNExtreme - 03.06.2010

You have to use bracets

pawn Код:
#include <a_samp>

#define COLOR_RED 0xCC0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFFC0CBAA

public OnPlayerCommandText (playerid, cmdtext[])
{
if (strcmp(cmdtext, "/drift", true) == 0)
{
GetPlayerVehicleID(playerid);
GetPlayerFacingAngle(playerid, Float:20);
SetPlayerScore(playerid, 1);
GivePlayerMoney(playerid, 200);
}
return 1;
}
Important note: I did not indent the code, please use the search button if you don't know what indentation is



Re: Need help with points and money - BaFTa - 03.06.2010

Here what it gives me now
Quote:

D:\Games\GTA San Andreas\MyServer\filterscripts\BaFTa`s [FS].pwn(17) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

1 Error.




Re: Need help with points and money - FUNExtreme - 03.06.2010

Sorry I didn't see that

The Float: means that the parameter has to be a float wich is a number like this: 0.0

So replace Float:20 with 20.0


Re: Need help with points and money - BaFTa - 03.06.2010

I did it and it gives me the same error again ;(
I`ve made one-two scripts and in each of them the Float: isn`t replaced. They work


Re: Need help with points and money - FUNExtreme - 03.06.2010

Oh xp
Fail

Use SetPlayerFacingAngle
GetPlayerFacingAngle is to get the angle as it says