HELP please /Q
#1

OK
This the command
PHP код:
if(strcmp(tmp"q"true) == || strcmp(tmp"quit"true) == 0)
        {
        if(
activity == 0) return SendClientMessage(playeridWhite"айп фтймеъ оефтмъ");
        if(
ActQ == 0) return SendClientMessage(playeridWhite"лбш йцаъ одфтймеъ");
        
SpawnPlayer(playerid);
        
SendClientMessage(playerid,0xd11111ff,"йцаъ одфтймеъ емлп щевшъ");
        
ActQ 0;
        return 
1;
        } 
Listen if player do /a q
He is spawn .. and if he do this again this is wrtie him : You can not to use the command again !
OK this is work !
but if one player do /a q
and other player do /a q this is write him : You can not to use the command again !
and he is doesn't do the command
why??
HELP
Reply
#2

Because ActQ is a global variable that is being set to 0 and there's no way to tell the difference between who used it or not, you need to make an array with cells for each player to store the data for each player, for example:

pawn Код:
new ActQ[MAX_PLAYERS];

if(strcmp(tmp, "q", true) == 0 || strcmp(tmp, "quit", true) == 0)
{
    if(activity == 0) return SendClientMessage(playerid, White, "айп фтймеъ оефтмъ");
    if(ActQ[playerid] == 0) return SendClientMessage(playerid, White, "лбш йцаъ одфтймеъ");
    SpawnPlayer(playerid);
    SendClientMessage(playerid,0xd11111ff,"йцаъ одфтймеъ емлп щевшъ");
    ActQ[playerid] = 0;
    return 1;
}
So then we are using a certain index in the array, specified by "playerid", which stores the unique ID of the player. Now the value is in essence, only relating to a single player.
Reply
#3

now ..
Me this is work
but if I no do the command
and the player do the command its write him : You Can Not ........
And me this is work WHY?
Reply
#4

What do you mean in "player"?
Reply
#5

Quote:
Originally Posted by lonako45
Посмотреть сообщение
now ..
Me this is work
but if I no do the command
and the player do the command its write him : You Can Not ........
And me this is work WHY?
You're probably making the same mistake with the "activity" variable, change it around so that it's like what I've shown you with ActQ.
Reply
#6

NO NO
OK
I find the problem
I do command /a s and if player do /a s : ActQ[playerid] = 1;
So I do [playerid] and I want to all ActQ = 1;
How I do that ?
ActQ[ToAll] ? :O
Reply
#7

Remove the variable from the command, lol.
Reply
#8

but I want if I do /a s
He can does /a q
Reply
#9

Dude, please explain what your command and send it.
the variable given you the ability to see who in the activity, btw send the command '/a s' too.
Reply
#10

OK
if /a s so ActQ = 1;
PHP код:
    if(strcmp(tmp"start"true) == || strcmp(tmp"s"true) == 0)
        {
            if(
GetAdminLevel(playerid) < && !IsPlayerAdmin(playerid) && GetAdminSpay(playerid) < && GetTempAdminLevel(playerid) < 1) return SendClientMessage(playeridWhite"шоъ дрйдем щмк роелд");
            if(
activity == 1) return SendClientMessage(playeridWhite"йщ фтймеъ оефтмъ , злд щъсъййн");
            new 
length strlen(cmdtext);
             while ((
idx length) && (cmdtext[idx] <= ' '))
            {
            
idx++;
            }
            new 
offset idx;
            new 
result[256];
            while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
            {
            
result[idx offset] = cmdtext[idx];
            
idx++;
            }
             
result[idx offset] = EOS;
             if(!
strlen(result)) return SendClientMessage(playeridyellow"/Activity Start [ActivityName] :цешъ щйоещ");
            
format(string1sizeof(string1),"дфтймеъ %s дефтмд тм йгй дазшай фтймейеъ/дордм",(result),GetName(playerid));
            
SendClientMessageToAll(0xff0000ff,string1);
            
SendClientMessageToAll(0xff0000ff,"/Activity дщйвешйн мфтймеъ рфъзе аеиеоийъ - лгй мшаеъ фчегеъ ресфеъ мфтймеъ");
            
GameTextForAll("~r~Activity ~b~Start~<~",20,1);
            
activity 1;
            
format(string1sizeof(string1),"%s", (result));
            
ActiveName string1;
            
format(string1sizeof(string1),"%s"GetName(playerid));
            
PlayerName string1;
            
ActivityTeleports 1;
            return 
1;
            }
          } 
if /a q
PHP код:
        if(strcmp(tmp"q"true) == || strcmp(tmp"quit"true) == 0)
        {
        if(
activity == 0) return SendClientMessage(playeridWhite"айп фтймеъ оефтмъ");
        if(
ActQ[playerid] == 0) return SendClientMessage(playeridWhite"лбш йцаъ одфтймеъ");
        
SpawnPlayer(playerid);
        
SendClientMessage(playerid,0xd11111ff,"йцаъ одфтймеъ емлп щевшъ");
        
ActQ[playerid] = 0;
        return 
1;
        } 
Now I can help ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)