#1

I made [gTeam] to mean that the play in swat skin, and i made in the class if the skin = 285, that'ss mean he is in skin. tho.
The problem is with my code, when ever i try to write /swatlist, it don't show me the online members, and it show me "There is no longer swat member" spammed.


[PWN] CMDwatlist(playerid,params[])
{
SendClientMessage(playerid, SwatC, "==========S.W.A.T List=========");
new sname[MAX_PLAYER_NAME];
for(new i; i < MAX_PLAYERS; i++)
{
GetPlayerName(i,sname,sizeof(sname));
if(pInfo[i] [pSwat] == 1 && gTeam[i] == Swat)
{
format(Jstring,sizeof(Jstring),"%s(%d) is online in S.W.A.T skin, rank: S", sname, i);
SendClientMessage(playerid,SwatC,Jstring);
}
else if(pInfo[i] [pSwat] == 2 && gTeam[i] == Swat)
{
format(Jstring,sizeof(Jstring),"%s(%d) is online in S.W.A.T skin, rank: D", sname, i);
SendClientMessage(playerid,SwatC,Jstring);
}
else if(gTeam[i] != Swat)
{
SendClientMessage(playerid,-1,"There is no S.W.A.T member online");
}
}
return 1;
}[/PWN]
Reply
#2

PHP код:
CMD:swatlist(playerid,params[])
{
    new 
OnlineSwatc 0;
    new 
Rank[i];
    foreach(
Playeri)
    {
    if(
IsPlayerConnected(i))
    {
    
SendClientMessage(playeridSwatC"==========S.W.A.T List=========");
    new 
sname[MAX_PLAYER_NAME];
    for(new 
iMAX_PLAYERSi++)
    {
          
GetPlayerName(i,sname,sizeof(sname));
          if(
pInfo[i] [pSwat] == && gTeam[i] == Swat)
          {
               
format(Jstring,sizeof(Jstring),"%s(%d) is online in S.W.A.T skin, rank: S"snamei);
               
SendClientMessage(playerid,SwatC,Jstring);
          }
          else if(
pInfo[i] [pSwat] == && gTeam[i] == Swat)
          {
               
format(Jstring,sizeof(Jstring),"%s(%d) is online in S.W.A.T skin, rank: D"snamei);
               
SendClientMessage(playerid,SwatC,Jstring);
          }
          else if(
gTeam[i] != Swat)
          {
                
SendClientMessage(playerid,-1,"There is no S.W.A.T member online");
          }
    }
    return 
1
Try This.
Reply
#3

Oh, I forgot to add is player connected, thanks m8.
+REP.
Reply
#4

Alittle problem, when ever i write the command, it says the rank, and there is swat member, ...........
Reply
#5

When u write the command it just says the rank? and there is a swat member online?
Reply
#6

if there is more than 1player online
It says, "there is no swat member online"
then they play is online in game
Reply
#7

Ive Edited the code see if it works now..
Reply
#8

I had these errors.
pawn Код:
C:\Users\queen\Desktop\samp037_svr_R2-1-1_win32\gamemodes\yo.pwn(1781) : error 017: undefined symbol "i"
C:\Users\queen\Desktop\samp037_svr_R2-1-1_win32\gamemodes\yo.pwn(1781) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\queen\Desktop\samp037_svr_R2-1-1_win32\gamemodes\yo.pwn(1781) : error 036: empty statement
C:\Users\queen\Desktop\samp037_svr_R2-1-1_win32\gamemodes\yo.pwn(1781) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#9

Bumb
Reply
#10

show the cod edited by ZToPMaN
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)