ShowPlayerDialog Don't work
#1

Hello , i have the following code to detect the players of Team 1 . I already defined teams but this code don't work.
PHP код:
CMD:team(playeridparams[])
{
   new 
String[256] = " "yname[MAX_PLAYER_NAME];
    for(new 
0MAX_PLAYERS++)
    {
        if(
IsPlayerConnected(i) && GetPlayerTeam(i) == 1)
        {
            
GetPlayerName(iynamesizeof(yname));
            
format(Stringsizeof(String), "%s%s (%d)\n"Stringynamei);
        }
    }
    
ShowPlayerDialog(playerid5555DIALOG_STYLE_MSGBOX,"Team:",String ,"Ok","");
    return 
1;

There was a code given to me by Schneider (SA-MP forum member) . and i change it to the above code to have function of only 1 gang . Following is the code that i got from Schneider.
PHP код:
CMD:team(playeridparams[])
{
    new 
String[256] = " "yname[MAX_PLAYER_NAME], team;
    if(
sscanf(params"i"team)) team GetPlayerTeam(playerid);
    if((
team 0) || (team 4))  return SendClientMessage(playerid, -1"Error: Invalid team-ID");  // change his to highest team ID.
    
for(new 0MAX_PLAYERS++)
    {
        if(
IsPlayerConnected(i) && GetPlayerTeam(i) == team)
        {          
            
GetPlayerName(iynamesizeof(yname));
            
format(Stringsizeof(String), "%s%s (%d)\n"Stringynamei);
        }
    }
    
ShowPlayerDialog(playerid5555DIALOG_STYLE_MSGBOX,"Team:",String ,"Ok","");
    return 
1;

I want to have this function for only gang no 1. If i use the 2nd code then it is working but if i use the 1st one then it don't work .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)