Issue with GetPlayerScore
#1

Код:
//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?
Reply
#2

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;
}
Reply
#3

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
Reply
#4

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.
Reply
#5

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$)");
}
Reply
#6

thank you all fixed and working now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)