Table Problem
#1

hej i made a system where players can talk to each other in a table
the problem is now that chat doesnt show for players that are in table
even to the hoster

codes

Код:
COMMAND:tt(playerid, params[])
{
    if(GetPVarInt(playerid,"ontable") == 0) return SendClientMessage(playerid, -1 , "You are not in any table");
    new iText[ 128 ];
    if(sscanf(params, "s", iText)) return SCP(playerid, "[msg]");
    format(iStr, sizeof(iStr),"(( [TABLE] %s: %s ))", RPName(playerid), iText);
    for(new i, j=GetPlayerPoolSize(); i<j; i++){if(GetPVarInt(i,"ontable") == GetPVarInt(playerid,"ontable")) {SendClientMessage(i, 0x216B98FF, iStr);}}
    return 1;
}
COMMAND:jointt(playerid, params[])
{
    new iPlayer;
    if(sscanf (params, "d",iPlayer)) return SCP(playerid, "[playerid]");
     if(GetPVarInt(iPlayer,"hosting") == 1) { SetPVarInt(playerid, "ontable", GetPVarInt(iPlayer,"ontable")); }
     return 1;
}
Reply
#2

Change
PHP код:
for(new ij=GetPlayerPoolSize(); i<ji++){if(GetPVarInt(i,"ontable") == GetPVarInt(playerid,"ontable")) {SendClientMessage(i0x216B98FFiStr);}} 
to
PHP код:
for(new ij=GetPlayerPoolSize(); i<=ji++){if(GetPVarInt(i,"ontable") == GetPVarInt(playerid,"ontable")) {SendClientMessage(i0x216B98FFiStr);}} 
You was alone when you tested it in the server?
Reply
#3

Thanks worked

Textdraw shows only 1 name
the first one
Код:
for(new i; i < MAX_PLAYERS; i++)
        {
             new tmpid = IsPlayerInBiz(playerid), tmpf[80];
             format(tmpf, sizeof(tmpf), "%s.txt", biz[tmpid][bizname]);
            if(!IsPlayerConnected(i)) continue;
            if(!IsPlayerInRangeOfPoint(i, 20.0, rPos[0], rPos[1], rPos[2])) continue;
            if(PlayerInfo[i][playerteam] != PlayerInfo[playerid][playerteam]) continue;
			
			new cashrobbing = dini_Int(tmpf,"bizcash")/ 5;
	        SetPVarInt(playerid, "robbingtime", GetPVarInt(playerid, "robbingtime") + 1 );

			new tst[500];
			format(tst,sizeof(tst),"Robbers:~n~%s~n~%s",tst,RPName(i));
			TextDrawSetString(robbTDD1[playerid],tst);
			TextDrawShowForPlayer(i,robbTDD1[playerid]);
		}
Reply
#4

Try this
PHP код:
for(new iMAX_PLAYERSi++)
        {
             new 
tmpid IsPlayerInBiz(playerid), tmpf[80];
             
format(tmpfsizeof(tmpf), "%s.txt"biz[tmpid][bizname]);
            if(!
IsPlayerConnected(i)) continue;
            if(!
IsPlayerInRangeOfPoint(i20.0rPos[0], rPos[1], rPos[2])) continue;
            if(
PlayerInfo[i][playerteam] != PlayerInfo[playerid][playerteam]) continue;
            
            new 
cashrobbing dini_Int(tmpf,"bizcash")/ 5;
            
SetPVarInt(i"robbingtime"GetPVarInt(i"robbingtime") + );
            new 
tst[500];
            
format(tst,sizeof(tst),"Robbers:~n~%s~n~%s",tst,RPName(i));
            
TextDrawSetString(robbTDD1[i],tst);
            
TextDrawShowForPlayer(i,robbTDD1[i]);
        } 
Reply
#5

tried
doesnt work still shows only 1 name on it
Reply
#6

PHP код:
new tst[500], ts[100];
format(tst500"Robbers:~n~");
for(new 
iMAX_PLAYERSi++) 
        { 
             new 
tmpid IsPlayerInBiz(playerid), tmpf[80]; 
             
format(tmpfsizeof(tmpf), "%s.txt"biz[tmpid][bizname]); 
            if(!
IsPlayerConnected(i)) continue; 
            if(!
IsPlayerInRangeOfPoint(i20.0rPos[0], rPos[1], rPos[2])) continue; 
            if(
PlayerInfo[i][playerteam] != PlayerInfo[playerid][playerteam]) continue; 
             
            new 
cashrobbing dini_Int(tmpf,"bizcash")/ 5
            
SetPVarInt(i"robbingtime"GetPVarInt(i"robbingtime") + ); 
            
format(ts100"%s~n~"RPName(i)); 
            
strcat(tstts);
        }  
TextDrawSetString(robbTDD1[i],tst); 
TextDrawShowForPlayer(i,robbTDD1[i]); 
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)