Something I've forgot
#1

Don't want to make another thread:

New problem is that I have a timer that needs to set your color to white if you're not in any faction.
It doesn't work :[

@top I have:
forward notfaction(playerid);

@ OnGameModeInit I have:
pawn Код:
SetTimer("notfaction",2000,true);
And my public

pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
return 1;
}
return 1;
}
Reply
#2

pawn Код:
foreach(Player, i)
{
    if(cop[i] >= 1)
    {
        // Code
    }
}
Reply
#3

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(cop[i] >= 1 && IsPlayerConnected(i))
    {
        format(string,sizeof(string),"There are %d cop members",i);
        SendClientMessageToAll(COLOR_YELLOW,string);
    }
}
(Damn to slow )
Reply
#4

Don't want to make another thread:

New problem is that I have a timer that needs to set your color to white if you're not in any faction.
It doesn't work :[

@top I have:
forward notfaction(playerid);

@ OnGameModeInit I have:
pawn Код:
SetTimer("notfaction",2000,true);
And my public

pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
return 1;
}
return 1;
}
Reply
#5

Edited with a new problem!
Reply
#6

pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
}
return 1;
}
Reply
#7

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
}
return 1;
}
It just sets ID 0 his color to white.
Even if he is in a faction : o
Reply
#8

Use SetTimerEx insteed
Reply
#9

pawn Код:
public OnPlayerConnect(playerid)
{
    SetTimerEx("notfaction", 2000, true, "i", playerid);
    return 1;
}
Reply
#10

Still sets player id 0 to white when he is in a faction
And no effect for other players.
My things now:

@onplayerconnect
pawn Код:
SetTimerEx("notfaction", 2000, true, "i", playerid);

My public
pawn Код:
public notfaction(playerid)
{
if(InFaction[playerid] == 0)
{
cop[playerid] = 0;
grove[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
}
return 1;
}
And my command to leave a faction. You possibly don't need this but still :P
pawn Код:
COMMAND:leavefaction(playerid,params[])
{
if(InFaction[playerid] <1) return SendClientMessage(playerid,COLOR_RED,"You're not even in any faction");
else
InFaction[playerid] = 0;
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)