Score system
#1

Hi guys,

i am here with another problem, i mean not a problem but.. question.

The thing i need is I cant find on internet or this forums some script witch will be like score system and stuff.

I will tell you what exactly i need.

I have an Cops vs Thief and I need a score system that will work for everybody.

So I got team Cop witch I need to be required by for example 50 points, so In OnPlayerRequestClass the player will be not enabled to select Cop if he will not have 50 points.

This is my OnPlayerRequestClass:
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 226.5244,2508.5847,16.5112);
	SetPlayerCameraPos(playerid, 244.7385,2508.5847,16.5092);
	SetPlayerCameraLookAt(playerid, 226.5244,2508.5847,16.5112);
	switch(classid) 
    {
         case 0:
         {
              GameTextForPlayer(playerid, "~r~Thief", 4000, 3);
              SetPlayerTeam(playerid, Thief);
         }
         case 1:
         {
              GameTextForPlayer(playerid, "~r~Cop", 4000, 3);
              SetPlayerTeam(playerid, Cop);
         }
    }
	return 1;
}
Everything works just fine, but I need to do, what i described up. I would be really thankful.

And the second thing is how to set these points and save them. I got my register system but I really need to save this points somehow.


And last thing about the missions. Or just commands, you can just write me how and I will. If someone for example complete mission that I would make, it will give him 50 points.

Thanks guys, i just need to know how to do it and beleive me I will do it.
Reply
#2

Will someone be please enabled to help me with this?
Reply
#3

SetPlayerScore to set his score, and GetPlayerScore to detect his current score.
So use GetPlayerScore and then save it with an saving system, MySQL, SQLite, y_ini etc.
Reply
#4

I am really big newbie, And... really? I didnt understand what you just said.

With (Set and Get) how can i make, that in the class selection, the player will be not enable to select the class without these points?..

Can you please describe more?
Reply
#5

Example:
pawn Код:
case 1:
{
    if(GetPlayerScore < 50) SendClientMessage(playerid, -1, "You need 50 score to be a cop.");
    else
    {
        GameTextForPlayer(playerid, "~r~Cop", 4000, 3);
        SetPlayerTeam(playerid, Cop);
    }
}
Should make him unable to spawn as a cop if he has less than 50 score.
Reply
#6

Awesome! But.. if I am selecting skins, it is not working, it is not showing me the skin of the COP guy, and I need it like it will be normally enabled to be seen but if he press shift or Select, it will write him the message showed above.
Reply
#7

Bump...

Please, please help me.
Reply
#8

Use the Wiki maybe?

Check GetPlayerScore(); and SetPlayerScore();
Reply
#9

Then use OnPlayerKeyStateChange or GetPlayerKeys to check if a player presses a key.
Reply
#10

Are you saving their score, if yes then it's quite easy. Be sure to set their score upon connection and then check if their score is at the required amount by GetPlayerScore.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)