How to name someting - 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: How to name someting (
/showthread.php?tid=673510)
How to name someting -
Calinut200 - 28.03.2020
Hello!
I wanna make if
PHP Code:
PlayerInfo[playerid][pJob]
is == 1
then when i use command /stats
PHP Code:
CMD:stats(playerid)
{
new string[258],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Numele: %s | Bani in mana: %i | Admin Level: %i | Job: %s",name, GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pJob]);
SendClientMessage(playerid,-1,string);
return 1;
}
Exemple: PlayerInfo[playerid][pJob] = 1 ; that job is fisherman
and in /stats at Job: %s to show 'Fisherman' not '1'.
Re: How to name someting -
David (Sabljak) - 29.03.2020
PHP Code:
new jobtext[8];
if(PlayerInfo[playerid][pJob] == JOBID) { jobtext= "JOB INFO"; }
else if(PlayerInfo[playerid][pJob] == JOBID) { jobtext= "JOB INFO"; }
Example,
PHP Code:
new jobtext[8];
if(PlayerInfo[playerid][pJob] == 1) { jobtext= "Fisherman"; }
PHP Code:
format(string,sizeof(string),"Numele: %s | Bani in mana: %i | Admin Level: %i | Job: %s",name, GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], jobtext);
Re: How to name someting -
Calinut200 - 29.03.2020
Quote:
Originally Posted by David (Sabljak)
PHP Code:
new jobtext[8];
if(PlayerInfo[playerid][pJob] == JOBID) { jobtext= "JOB INFO"; }
else if(PlayerInfo[playerid][pJob] == JOBID) { jobtext= "JOB INFO"; }
Example,
PHP Code:
new jobtext[8];
if(PlayerInfo[playerid][pJob] == 1) { jobtext= "Fisherman"; }
PHP Code:
format(string,sizeof(string),"Numele: %s | Bani in mana: %i | Admin Level: %i | Job: %s",name, GetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], jobtext);
|
And how to make
PlayerInfo[playerid][pJob] == 1; When is type getjob because is say in console that is not work
Re: How to name someting -
SiaReyes - 29.03.2020
Code:
CMD:getjob(playerid)
{
if(PlayerInfo[playerid][pJob] == 1) return SendClientMessage(playerid, -1, "You are already in fisherman job");
return 1;
}