Making An Achievement +REP
#1

Код:
/////////////////////////////* Adding your own *///////////////////////////////

/*
public YOUROWNCALLBACK() //Change to a Callback of your choice
{
    new file[128], pname[MAX_PLAYER_NAME];
  	GetPlayerName(playerid, pname, sizeof(pname));
  	format(file, sizeof(file), "/UserAchievements/%s.ini", pname);
  	if(dini_Int(file, "NAMEOFDATA") == 1) //Change NAMEOFDATA to a data type of your choice
	{
	    //Do nothing
	}
	else if(dini_Int(file, "NAMEOFDATA") == 0) //Change NAMEOFDATA to a data type of your choice
	{
		ShowAchievement();
		dini_IntSet(file, "NAMEOFDATA", 1); //Change NAMEOFDATA to a data type of your choice
		SendClientMessage(playerid, COLOR_GREEN, "Achievement Get! WHAT EVER YOU WANT");
	}
    return 1;
}
*/
FS Link : https://sampforum.blast.hk/showthread.php?tid=349990

"NAMEOFDATA" ----------- How to make when player gets 100 score ?
Please tell me
Reply
#2

pawn Код:
/////////////////////////////* Adding your own *///////////////////////////////

/*
public YOUROWNCALLBACK() //Change to a Callback of your choice
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "/UserAchievements/%s.ini", pname);
    if(dini_Int(file, "NAMEOFDATA") == 1) //Change NAMEOFDATA to a data type of your choice
    {
        //Do nothing
    }
    else if(dini_Int(file, "NAMEOFDATA") == 0) //Change NAMEOFDATA to a data type of your choice
    {
        ShowAchievement();
        dini_IntSet(file, "NAMEOFDATA", 1); //Change NAMEOFDATA to a data type of your choice
        SendClientMessage(playerid, COLOR_GREEN, "Achievement Get! WHAT EVER YOU WANT");
                SetPlayerScore(playerid, GetPlayerScore(playerid)+100);//giving 100 score..
    }
    return 1;
}
*/
Reply
#3

No No No
Uch That my English

I want to do as a player reaches 100 Score , he completes the task Get 100 Score
Reply
#4

Look An Example

Quote:

new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "/UserAchievements/%s.ini", pname);
if(dini_Int(file, "vehicle") == 1)
{
return 1;
}
else if(dini_Int(file, "vehicle") == 0)
{
ShowAchievement();
dini_IntSet(file, "vehicle", 1);
SendClientMessage(playerid, COLOR_GREEN, "Achievement Get! You got in a vehicle for the first time.");
return 1;
}

There was changed NAMEOFDATA
Reply
#5

Avaibale dini_IntSet(file, "spawn", 0);
dini_IntSet(file, "death", 0);
dini_IntSet(file, "pickup", 0);
dini_IntSet(file, "vehicle", 0);
dini_IntSet(file, "clickplayer", 0);
dini_IntSet(file, "dialog", 0);
dini_IntSet(file, "command", 0);
dini_IntSet(file, "score", 0);
dini_IntSet(file, "money", 0);



Maybe


Quote:

/////////////////////////////* Adding your own *///////////////////////////////

/*
public YOUROWNCALLBACK() //Change to a Callback of your choice
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "/UserAchievements/%s.ini", pname);
if(dini_Int(file, "score") == 100) //Change NAMEOFDATA to a data type of your choice
{
//Do nothing
}
else if(dini_Int(file, "score") == 100) //Change NAMEOFDATA to a data type of your choice
{
ShowAchievement();
dini_IntSet(file, "score", 100); //Change NAMEOFDATA to a data type of your choice
SendClientMessage(playerid, COLOR_GREEN, "Achievement Get! WHAT EVER YOU WANT");
}
return 1;
}
*/

i dont know help me
Reply
#6

Put this at the top of your script
pawn Код:
new Achievement[MAX_PLAYERS];
Put this under OnPlayerSpawn
pawn Код:
if(GetPlayerScore(playerid) >= 100 && Achievement[playerid] !=1)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) +100);
Achievement[playerid]=1;
}
Reply
#7

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Put this at the top of your script
pawn Код:
new Achievement[MAX_PLAYERS];
Put this under OnPlayerSpawn
pawn Код:
if(GetPlayerScore(playerid) >= 100 && Achievement[playerid] !=1)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) +100);
Achievement[playerid]=1;
}
Nooooooo its not a new script
i just wanna add a Achievement for exiting Script on the Top
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)