SA-MP Forums Archive
change - 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: change (/showthread.php?tid=295555)



change - manchestera - 06.11.2011

How can i change this to give score instead of give money i know how to do it normally but not sure how to do it when it has para

Код:
GivePlayerMoney(playerid,Race[Player[playerid][IdRace]][Cost]*2);
Many thanks


Re: change - Kostas' - 06.11.2011

I guess to change it to Score, I don't know if it works with all this you added
pawn Код:
GivePlayerScore(playerid,Race[Player[playerid][IdRace]][Cost]*2);



Re: change - SmiT - 06.11.2011

pawn Код:
SetPlayerScore( playerid, GetPlayerScore( playerid ) + Race[ Player [ playerid ][ IdRace ] ][ Cost ] * 2 );



Re: change - manchestera - 06.11.2011

Yer i got a error

Код:
C:\Users\GTA ONLY\Desktop\The Eclipse V4.8\filterscripts\PRaceSystemEng.pwn(811) : error 017: undefined symbol "GivePlayerScore"
Is there are i can define it with the normal way i would do it?


Re: change - Kostas' - 06.11.2011

My mad, it was wrong. SmiT's way is the correct


Re: change - manchestera - 06.11.2011

Quote:
Originally Posted by SmiT
Посмотреть сообщение
pawn Код:
SetPlayerScore( playerid, GetPlayerScore( playerid ) + Race[ Player [ playerid ][ IdRace ] ][ Cost ] * 2 );
Will this not just set the players score not added it to the players score they already have?


Re: change - Kostas' - 06.11.2011

It get player score and set the number you want.
I knew that you can set +1 for example. I am not sure if the *2 works


Re: change - manchestera - 06.11.2011

ill try that as it compiled but had no effect ingame


Re: change - SmiT - 06.11.2011

Quote:
Originally Posted by manchestera
Посмотреть сообщение
Will this not just set the players score not added it to the players score they already have?
It will be added to the player score.

SetPlayerScore( playerid, GetPlayerScore( playerid ) + Race[ Player [ playerid ][ IdRace ] ][ Cost ] * 2 );

EDIT: If you want GivePlayerScore function you can simply do:
pawn Код:
stock GivePlayerScore( playerid, score ) SetPlayerScore( playerid, GetPlayerScore( playerid ) + score );
And you can use Kostas' way! -
pawn Код:
GivePlayerScore( playerid, Race[ Player [ playerid ][ IdRace ] ][ Cost ] * 2 );



Re: change - manchestera - 06.11.2011

Thanks Guys got it working now ive tried to rep you but i must have reped you before so many thanks.