How to show Player's Team in a Dialog -
humayunaftabkhan02 - 02.05.2016
So I was making a /info command which tells player his information like if he has drugs, wallet etc.
I wanted to make that the /info command also shows his team name like Police Officer / Army Officer / Civillian
I can do that by SendClientMessage but how do I do it as a dialog.
This is how I did using SendClientMessage:
pawn Код:
if(gTeam[giveplayerid] == TEAM_COP) {
SendClientMessage(playerid,-1,"{FF0000}Skill/Job: {FFFFFF}Police Officer");
}
else
if(gTeam[giveplayerid] == TEAM_ARMY) {
SendClientMessage(playerid,-1,"{FF0000}Skill/Job: {FFFFFF}Army");
}
..and so on.
I want to make this show in Dialog that If he's a Police Officer, It'll show Skill/Job: Police Officer
Please do explain too as I'm new and I would like to learn it so I won't come again asking for the same.
Re: How to show Player's Team in a Dialog -
Godey - 02.05.2016
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Still confused?
https://sampforum.blast.hk/showthread.php?tid=109610
What you want:
Код:
#define DIALOG_SCLS 1001 // On top of the script
ShowPlayerDialog(playerid, DIALOG_SCLS, DIALOG_STYLE_MSGBOX, "Class help", "{FF0000}Skill/Job: {FFFFFF}Police Office", "OK", "");
Re: How to show Player's Team in a Dialog -
Dayrion - 02.05.2016
Alright. If i have corretly understand this looks like that, there is an exemple here. (Maybe wrong, sorry)
PHP код:
#include <zcmd>
#include <sscanf2>
CMD:info(playerid, params[])
{
switch(gTeam[giveplayerid])
{
case TEAM_COP:
{
new str[90];
format(str, sizeof(str), "{FF0000}Skill/Job: {FFFFFF}Police Officer");
}
case TEAM_ARMY:
{
new str[90];
format(str, sizeof(str), "{FF0000}Skill/Job: {FFFFFF}Army");
}
ShowPlayerDialog(playerid, 986, DIALOG_MSGBOX, "Infos", str, "button1", "button2");
}
return 1;
}
Re: How to show Player's Team in a Dialog -
humayunaftabkhan02 - 02.05.2016
I know this but I wanted to make something like, the dialog will show whichever team he would be in. Not only Police Officer for every team.
pawn Код:
if(gTeam[playerid] == TEAM_COP)
{
format(occupation, sizeof(occupation), "Police Officer");
}
else if(gTeam[playerid] == TEAM_ARMY)
{
format(occupation, sizeof(occupation),"S.A. Army Officer");
}
else if(gTeam[playerid] == TEAM_CIVIL)
{
format(occupation, sizeof(occupation),"Civillian");
}
else if(gTeam[playerid] == TEAM_CARFIX)
{
format(occupation, sizeof(occupation),"Mechanic");
}
else if(gTeam[playerid] == TEAM_MEDIC)
{
format(occupation, sizeof(occupation),"Medic");
}
It's fixed now. This was what I wanted.
Thankyou for your reply mate!
Edit: Yes Dayrion, this was exactly what I wanted. Thank you so much mate! <3
Re: How to show Player's Team in a Dialog -
Godey - 02.05.2016
No problem and good luck!
Re: How to show Player's Team in a Dialog -
Dayrion - 02.05.2016
Alright, that's great! Good luck for your script!