My command only works for ID 0 :/
#1

My command only works for ID 0 this is it:

pawn Код:
public C0(playerid)
{
        new string[256];
        format(string, sizeof(string), "~n~~n~~n~~g~ Wojna Gangow!!! ");
        GameTextForAll(string, 8001, 3);
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerConnected(i)) WG40[i] = 0;
        }
        if(ONWG[playerid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SetCameraBehindPlayer(playerid);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
}

This is the part that only works for ID 0: :/

pawn Код:
if(ONWG[playerid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SetCameraBehindPlayer(playerid);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
Reply
#2

Quote:
Originally Posted by pawelf94
pawn Код:
if(ONWG[playerid] == 1)
This seems to be the bugg-causing line.

I guess we'd need to know how players get "ON‌WG == 1", to solve that. The problem has to be there, in my opinion.
Reply
#3

pawn Код:
public C0(playerid)
{
        new string[256];
        format(string, sizeof(string), "~n~~n~~n~~g~ Wojna Gangow!!! ");
        GameTextForAll(string, 8001, 3);
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerConnected(i)) WG40[i] = 0;
        }
        if(ONWG[playerid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SetCameraBehindPlayer(playerid);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
}
This is a timer and this timer gets started off by

pawn Код:
if(strcmp(cmd, "/wg1", true) == 0 && IsPlayerAdmin(playerid))
    {
    SetTimer("C0",41000,0);
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerConnected(i)) WG40[i] = 1, P30[i] = 1;
        }
        return 1;
    }
Reply
#4

Quote:
Originally Posted by pawelf94
pawn Код:
public C0(playerid)
{
        new string[256];
        format(string, sizeof(string), "~n~~n~~n~~g~ Wojna Gangow!!! ");
        GameTextForAll(string, 8001, 3);
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerConnected(i)) WG40[i] = 0;
        }
        if(ONWG[playerid] == 1)
        {
            TogglePlayerControllable(playerid, 1);
            SetCameraBehindPlayer(playerid);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
}
This is a timer and this timer gets started off by

pawn Код:
if(strcmp(cmd, "/wg1", true) == 0 && IsPlayerAdmin(playerid))
    {
    SetTimer("C0",41000,0);
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerConnected(i)) WG40[i] = 1, P30[i] = 1;
        }
        return 1;
    }
No i mean somewhere has to be the line/code :

pawn Код:
ONWG[playerid]=1; //(with just one "=" and with ";")
Please post it.
Reply
#5

This is the problem

SetTimer("C0",41000,0);


You need to use SetTimerEx
SetTimer("C0",41000,0,"i",playerid);
Reply
#6

pawn Код:
if(strcmp(cmd, "/dolacz", true) == 0)
    {
        if(ONWG[playerid] == 0)
        {
            if(WG40[playerid] == 1)
            {
                if(P30[playerid] == 1)
                {
                    for(new i; i<MAX_PLAYERS; i++)
                    {
                      if(IsPlayerConnected(i)) P29[i] = 1, P30[i] = 0;
                    }
                    ONWG[playerid] = 1;
                GivePlayerWeapon(playerid, 343, 9999);
                GivePlayerWeapon(playerid, 348, 9999);
                GivePlayerWeapon(playerid, 351, 9999);
                GivePlayerWeapon(playerid, 355, 9999);
                GivePlayerWeapon(playerid, 353, 9999);
                    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
                  SetPlayerInterior(playerid, 15);
                    SetPlayerPos(playerid,2190.2075,-1141.6069,1029.7969);
                    SetPlayerFacingAngle(playerid, 173.8527);
                    TogglePlayerControllable(playerid, 0);
                    SetPlayerColor(playerid, COLOR_GREEN);
                    SetPlayerVirtualWorld(playerid, 1);
                    SetPlayerSkin( playerid, 269 );//groove leader
                    SetPlayerHealth(playerid, 100);
                    SetPlayerArmour(playerid, 100);
                }
Reply
#7

I DID THIS:

pawn Код:
public C0(playerid)
{
        new string[256];
        format(string, sizeof(string), "~n~~n~~n~~g~ Wojna Gangow!!! ");
        GameTextForAll(string, 8001, 3);
        for(new i; i<MAX_PLAYERS; i++)
        {
          if(IsPlayerConnected(i)) WG40[i] = 0;
        }
        SetTimerEx("WGSTART",0001,0,"i",playerid);
}

public WGSTART(playerid)
{
    if(ONWG[playerid] == 1)
    {
        TogglePlayerControllable(playerid, 1);
        SetCameraBehindPlayer(playerid);
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    }
}
AND ITS STILL FOR ID 0
Reply
#8

your SetTimerEx needs to be in the command. Your SetTimer needs to be SetTimerEx. Not in your timer!

pawn Код:
if(strcmp(cmd, "/wg1", true) == 0 && IsPlayerAdmin(playerid))
{
    SetTimer("C0",41000,0);
for(new i; i<MAX_PLAYERS; i++)
{
  if(IsPlayerConnected(i)) WG40[i] = 1, P30[i] = 1;
}
return 1;
}
SetTimer needs to be SetTimerEx (see Joe's comment)
Reply
#9

i done this and now it only works for the player that does the command whatever id he is it works for him only :/
Reply
#10

http://pastebin.com/d28ab2b23

this is my map, check whats wrong
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)