Help [/wanted] dialog. -
Edu4rd - 31.05.2014
Hello, I order /wanted dialogue and want to show everyone that they wanted not just one, you have to do to look at all not just one? Please help me.
Command:
PHP код:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new jobs[1024];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(WantedLevel[i] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(jobs, sizeof(jobs), "%s - Wanted Level {FF0000}%d\n{FFFFFF}",giveplayer,WantedLevel[i]);
ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",jobs,"Ok", "");
}
else
{
SendClientMessage(playerid, COLOR_BANI, "Momentan nu sunt suspecti cu wanted.");
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
}
}//not connected
return 1;
}
Re: Help [/wanted] dialog. -
Eth - 31.05.2014
pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new jobs[1024];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(WantedLevel[i] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(jobs, sizeof(jobs), "%s - Wanted Level {FF0000}%d\n{FFFFFF}",giveplayer,WantedLevel[i]);
ShowPlayerDialog(i,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",jobs,"Ok", "");
}
else
{
SendClientMessage(playerid, COLOR_BANI, "Momentan nu sunt suspecti cu wanted.");
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
}
}//not connected
return 1;
}
Re: Help [/wanted] dialog. -
Edu4rd - 31.05.2014
Back to edit, I'm going to test.
Re: Help [/wanted] dialog. -
Edu4rd - 31.05.2014
Do not go ... just look at the player and wantedu older, I want to show that they wanted all players, not just one
Re: Help [/wanted] dialog. -
SilentSoul - 31.05.2014
pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new jobs[1024];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(WantedLevel[i] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(jobs, sizeof(jobs), "%s %s- Wanted Level {FF0000}%d\n{FFFFFF}",jobs,giveplayer,WantedLevel[i]);
ShowPlayerDialog(i,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",jobs,"Ok", "");
}
else
{
SendClientMessage(playerid, COLOR_BANI, "Momentan nu sunt suspecti cu wanted.");
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
}
}//not connected
return 1;
}
Re: Help [/wanted] dialog. -
AiRaLoKa - 01.06.2014
pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new jobs[254];
new string[1024];
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(WantedLevel[i] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(jobs, sizeof(jobs), "%s%s - Wanted Level {FF0000}%d\n{FFFFFF}",string,giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
strcat(string,jobs);
}
}
}
ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",string,"Ok", "");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
}
}//not connected
return 1;
}
hope this help
Re: Help [/wanted] dialog. -
Threshold - 01.06.2014
pawn Код:
if(strcmp(cmdtext, "/wanted", true) == 0)
{
if(!IsPlayerConnected(playerid)) return 1;
if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
new jobs[1024], count = 0, fstr[65], wantedname[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!WantedLevel[i]) continue;
count++;
if(count > 15) continue;
GetPlayerName(i, wantedname, sizeof(wantedname));
format(fstr, sizeof(fstr), "%s - Wanted Level {FF0000}%d\n{FFFFFF}", wantedname, WantedLevel[i]);
strcat(jobs, fstr);
}
if(!count) return SendClientMessage(playerid, COLOR_BANI, "Momentan nu sunt suspecti cu wanted.");\
else if(count > 15)
{
format(fstr, sizeof(fstr), "{FF0000}Exista o suplimentare de %d vrut jucatori online.", (count - 15));
strcat(jobs, fstr);
}
ShowPlayerDialog(playerid, 153, DIALOG_STYLE_MSGBOX, "Suspecti cu wanted", jobs, "Ok", "");
return 1;
}
Sorry if my translation isn't correct, lol.
Re: Help [/wanted] dialog. -
Edu4rd - 01.06.2014
AiRaLoKa, the id 0 show 2 times when someone has wanted and the id 1 shows correctly.
Re: Help [/wanted] dialog. -
AiRaLoKa - 01.06.2014
sorry about that, it's my mistake :3
i don't know is it work or not....
pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid))
{
new jobs[254];
new string[1024];
new count=0;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(WantedLevel[i] > 0)
{
GetPlayerName(i, giveplayer, sizeof(giveplayer));
if(count == 0)
{
format(jobs, sizeof(jobs), "%s - Wanted Level {FF0000}%d\n{FFFFFF}",giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
}
else if(count > 0)
{
format(jobs, sizeof(jobs), "%s%s - Wanted Level {FF0000}%d\n{FFFFFF}",string,giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
}
strcat(string,jobs);
count++;
}
}
}
ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",string,"Ok", "");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
}
}//not connected
return 1;
}
Re: Help [/wanted] dialog. -
Edu4rd - 01.06.2014
Thanks, I'll come back to edit if it works or not