SA-MP Forums Archive
help me about exp - 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: help me about exp (/showthread.php?tid=631495)



help me about exp - Jihanz - 30.03.2017

help ! how to show my exp in SendClientMessage ?

PHP код:
CMD:test(playeridparams[])
{
    new 
exp GetPlayerScore(playerid);
    
SetPlayerScore(Playerid,exp+1);
    
format(exp,sizeof(exp),"Exp:%i/%i",GetPlayerScore(playerid),JumlahExp[playerid]);
    
SendClientMessage(playerid,warna_biru,exp);
    return 
1;

i got this
PHP код:
D:\data aji\Samp server\gamemodes\fr1.pwn(1609) : error 017undefined symbol "Playerid"
D:\data aji\Samp server\gamemodes\fr1.pwn(1610) : error 035argument type mismatch (argument 1)
D:\data aji\Samp server\gamemodes\fr1.pwn(1610) : error 035argument type mismatch (argument 1)
D:\data aji\Samp server\gamemodes\fr1.pwn(1611) : error 035argument type mismatch (argument 3)
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors




Re: help me about exp - Toroi - 30.03.2017

https://sampwiki.blast.hk/wiki/Format

The output of a format always has to be a string value, however you're trying to fit it into an integer

Код:
new exp = GetPlayerScore(playerid); 
format(exp,sizeof(exp),"Exp:%i/%i",GetPlayerScore(playerid),JumlahExp[playerid]);
You almost have your code right. Convert the exp integer to a string and remove that value assignation to the GetPlayerScore function. In the following line, instead of exp inside the SetPlayerScore function you can use the GetPlayerScore function itself plus one.

Try it and come back if you need more help.


Re: help me about exp - Jihanz - 30.03.2017

Quote:
Originally Posted by Troydere
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Format

The output of a format always has to be a string value, however you're trying to fit it into an integer

Код:
new exp = GetPlayerScore(playerid); 
format(exp,sizeof(exp),"Exp:%i/%i",GetPlayerScore(playerid),JumlahExp[playerid]);
You almost have your code right. Convert the exp integer to a string and remove that value assignation to the GetPlayerScore function. In the following line, instead of exp inside the SetPlayerScore function you can use the GetPlayerScore function itself plus one.

Try it and come back if you need more help.
Thanks i try this


Re: help me about exp - Jihanz - 30.03.2017

how to differentiate exp and scores ?


Re: help me about exp - Toroi - 30.03.2017

Depends on your script, as I can see JumlahExp[MAX_PLAYERS] is your exp variable, the default player score is your score variable, you can change or modify them as you like. As an example, by killing someone you could add +=2 to the exp value and +1 to the player score value.


Re: help me about exp - Jihanz - 30.03.2017

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Depends on your script, as I can see JumlahExp[MAX_PLAYERS] is your exp variable, the default player score is your score variable, you can change or modify them as you like. As an example, by killing someone you could add +=2 to the exp value and +1 to the player score value.
Example

PHP код:
new JumlahExp[MAX_PLAYERS] = 10
its mean MAX Exp is 10

Now where do I get one plus one exp it bringing the total to 2 exp
how to call this 2 exp said ?
whether using a variable or another?

I've tried using a variable but not called
example
PHP код:
enum pInfo{
Exp,
}
PlayerInfo[MAX_PLAYERS][pInfo]; 
so I called her into
PHP код:
PlayerInfo[playerid][Exp
when I use these variables, but without success
example
PHP код:
CMD:test(playeridparams[]){
new 
exp;
format(exp,sizeof(exp),"Exp:%i/%i",PlayerInfo[playerid][Exp],JumlahExp[playerid]);
SendClientMessage(playerid,col_green,exp);

maybe you can do it Sorry if I ask many questions

Thanks Before


Re: help me about exp - Jihanz - 30.03.2017

Quote:
Originally Posted by Troydere
Посмотреть сообщение
Depends on your script, as I can see JumlahExp[MAX_PLAYERS] is your exp variable, the default player score is your score variable, you can change or modify them as you like. As an example, by killing someone you could add +=2 to the exp value and +1 to the player score value.
wait Its Solved bro
thanks Troydere for reply my post