SA-MP Forums Archive
Issue with GetPlayerScore - 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: Issue with GetPlayerScore (/showthread.php?tid=519537)



Issue with GetPlayerScore - Steel_ - 14.06.2014

Код:
//level system
CMD:buylevel(playerid, params[])
{
      GivePlayerMoney(playerid, -1000);
      SetPlayerScore(playerid, 1);
      return 1;
}

 line 334 >>if(GetPlayerScore(playerid)> 50)
{
	 CMD:godon(playerid, params[])
	 {
		  SetPlayerHealth(playerid, 99999)
		  ;
     }
Код:
C:\Users\Modris\Desktop\Project\gamemodes\stuntcapital.pwn(334) : error 010: invalid function or declaration
Where's the problem?


AW: Issue with GetPlayerScore - Nero_3D - 14.06.2014

You need to move the if statment inside

pawn Код:
//level system
CMD:buylevel(playerid, params[])
{
    if(GetPlayerMoney(playerid) >= 1000)
    {
        GivePlayerMoney(playerid, -1000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
    }
    return true;
}

CMD:godon(playerid, params[])
{
    if(GetPlayerScore(playerid) > 50)
    {
        SetPlayerHealth(playerid, 99999.9);
    }
    return true;
}



Re: Issue with GetPlayerScore - Steel_ - 14.06.2014

It doesnt show the error code any more but now In Game the /buylevel command doesnt work it just doesnt do anything doesnt even show SERVER:Unknown Command


Re: Issue with GetPlayerScore - iFiras - 14.06.2014

Quote:
Originally Posted by Wizdo
Посмотреть сообщение
It doesnt show the error code any more but now In Game the /buylevel command doesnt work it just doesnt do anything doesnt even show SERVER:Unknown Command
Are you sure? Probably you didn't add the command.
Nero_3D's code looks perfect, nothing's wrong in it.


AW: Issue with GetPlayerScore - Nero_3D - 14.06.2014

Than just add some messages so you know what is going on
pawn Код:
CMD:buylevel(playerid, params[])
{
    if(GetPlayerMoney(playerid) >= 1000)
    {
        GivePlayerMoney(playerid, -1000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
        return SendClientMessage(playerid, -1, "You reached a new level");
    }
    return SendClientMessage(playerid, -1, "You don't have enough money (>= 1000$)");
}



Re: Issue with GetPlayerScore - Steel_ - 14.06.2014

thank you all fixed and working now