Help me in this stock [HELP]
#1

I have this stock
That shows who is online from admins:
PHP код:
stock ShowAdminsFor(playerid)
{
    for(new 
i=0j=GetPlayerPoolSize(); i<=j;i++)
    {
        if(
PInfo[i][Adminlevel] > 1)
        {
            new 
str[180];
            
format(str180"%s[%d]"GetPlayerNameEx(i), PInfo[i][Adminlevel]);
            
SendClientMessage(playeridCOLOR_YELLOWstr);
        }
        
    }

How I can say that if there is no one admins send a message with there is no admins?
Reply
#2

PHP код:
stock ShowAdminsFor(playerid)
{
    for(new 
i=0j=GetPlayerPoolSize(); i<=j;i++)
    {
        if(
PInfo[i][Adminlevel] > 1)
        {
            new 
str[180];
            
format(str180"%s[%d]"GetPlayerNameEx(i), PInfo[i][Adminlevel]);
            
SendClientMessage(playeridCOLOR_YELLOWstr);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_YELLOW"There is no administrators online.");
        }
    }

Reply
#3

Quote:
Originally Posted by willbedie
Посмотреть сообщение
PHP код:
stock ShowAdminsFor(playerid)
{
    for(new 
i=0j=GetPlayerPoolSize(); i<=j;i++)
    {
        if(
PInfo[i][Adminlevel] > 1)
        {
            new 
str[180];
            
format(str180"%s[%d]"GetPlayerNameEx(i), PInfo[i][Adminlevel]);
            
SendClientMessage(playeridCOLOR_YELLOWstr);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_YELLOW"There is no administrators online.");
        }
    }

This won't work very well.
anyone else please.
Reply
#4

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
This won't work very well.
anyone else please.
What does not work there?
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=378426
try g00gling before you post, there are a lot useful threads around
Reply
#6

Quote:
Originally Posted by willbedie
Посмотреть сообщение
What does not work there?
First its should be this:
PHP код:
stock ShowAdminsFor(playerid)
{
    for(new 
i=0j=GetPlayerPoolSize(); i<=j;i++)
    {
        if(
PInfo[i][Adminlevel] > 1)
        {
            new 
str[180];
            
format(str180"%s[%d]"GetPlayerNameEx(i), PInfo[i][Adminlevel]);
            
SendClientMessage(playeridCOLOR_YELLOWstr);
        }
        else
        {
           return 
SendClientMessage(playeridCOLOR_YELLOW"There is no administrators online.");
        }
    }
    return 
1;

second try this and it won't work
with u ar telling that if i < 1 u gonna send there is no admins online.
Reply
#7

I am trying to help you and you're trying to be rude lmao learn scripting yourself then, fuck off.
Reply
#8

Quote:
Originally Posted by willbedie
Посмотреть сообщение
I am trying to help you and you're trying to be rude lmao learn scripting yourself then, fuck off.
Reply
#9

PHP код:
stock ShowAdminsFor(playerid
{
    new 
admins 0;
    for(new 
i=0j=GetPlayerPoolSize(); i<=j;i++) 
    { 
        if(
PInfo[i][Adminlevel] > 1
        { 
            new 
str[180]; 
            
format(str180"%s[%d]"GetPlayerNameEx(i), PInfo[i][Adminlevel]); 
            
SendClientMessage(playeridCOLOR_YELLOWstr);
            
admins ++;
        } 
    } 
    if(
admins 1SendClientMessage(playerid,-1,"No Admins online");

Reply
#10

Quote:
Originally Posted by Mugala
Посмотреть сообщение
PHP код:
stock ShowAdminsFor(playerid
{
    new 
admins 0;
    for(new 
i=0j=GetPlayerPoolSize(); i<=j;i++) 
    { 
        if(
PInfo[i][Adminlevel] > 1
        { 
            new 
str[180]; 
            
format(str180"%s[%d]"GetPlayerNameEx(i), PInfo[i][Adminlevel]); 
            
SendClientMessage(playeridCOLOR_YELLOWstr);
            
admins ++;
        } 
    } 
    if(
admins 1SendClientMessage(playerid,-1,"No Admins online");

This !
+REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)