21.09.2015, 11:59
This is the script:
stock givescore(playerid, ammount)
{
new currentscore;
currentscore = GetPlayerScore(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid)+ammount);
}
new bool:Milestone[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Milestone[playerid] = false;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/milestone1", cmdtext, true, 10) == 0)
if(GetPlayerMoney(playerid) >= 10000)
{
givescore(playerid, 10);
if(Milestone[playerid]) return SendClientMessage(playerid, -1, "Tu jau atsiemėi љį milestone.");
return 1;
}
return 0;
}
It should let player use this command only one time, but it shows that there is no such command and player can use it how much they want, and it always adds score. Any suggestions?
stock givescore(playerid, ammount)
{
new currentscore;
currentscore = GetPlayerScore(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid)+ammount);
}
new bool:Milestone[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Milestone[playerid] = false;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/milestone1", cmdtext, true, 10) == 0)
if(GetPlayerMoney(playerid) >= 10000)
{
givescore(playerid, 10);
if(Milestone[playerid]) return SendClientMessage(playerid, -1, "Tu jau atsiemėi љį milestone.");
return 1;
}
return 0;
}
It should let player use this command only one time, but it shows that there is no such command and player can use it how much they want, and it always adds score. Any suggestions?