SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/03/2020, 11:53 PM   #1
Calinut200
Big Clucker
 
Join Date: Jun 2016
Posts: 74
Reputation: 0
Default How to name someting

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",nameGetPlayerMoney(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'.
Calinut200 is offline   Reply With Quote
Old 29/03/2020, 01:05 AM   #2
David (Sabljak)
Huge Clucker
 
Join Date: Nov 2011
Posts: 342
Reputation: 18
Default Re: How to name someting

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",nameGetPlayerMoney(playerid), PlayerInfo[playerid][pAdmin], jobtext); 
David (Sabljak) is offline   Reply With Quote
Old 29/03/2020, 01:14 AM   #3
Calinut200
Big Clucker
 
Join Date: Jun 2016
Posts: 74
Reputation: 0
Default Re: How to name someting

Quote:
Originally Posted by David (Sabljak) View Post
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",nameGetPlayerMoney(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
Calinut200 is offline   Reply With Quote
Old 29/03/2020, 03:33 AM   #4
SiaReyes
Gangsta
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 617
Reputation: 57
Default Re: How to name someting

Code:
CMD:getjob(playerid)
{
if(PlayerInfo[playerid][pJob] == 1)  return SendClientMessage(playerid, -1, "You are already in fisherman job");

return 1;
}
SiaReyes is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I create command and i need someting. GBLTeam Help Archive 1 14/03/2011 10:11 PM


All times are GMT. The time now is 02:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.