A Little bit! help please =]!
#1

Amm, here's the error :

PHP код:
C:\Documents and Settings\gidon\щемзп дтбегд\дчбцйн щм бп\CS1.6\gamemodes\cs1.6.pwn(303) : error 008must be a constant expressionassumed zero 
Here's the line :

PHP код:
    if{dwON == true
Another lines wich is contacted to line 303 :

PHP код:
new bool:dwON=false
PHP код:
                    dwON=true
Reply
#2

Anyway, since I've fixed it already by my self, I wonder if someone who had this problem also, want it to be solved, since there are alot of people with kinda problems.

Alright, so.. how I've fixed it :
I've created an enum:

PHP код:
enum pInfo
{
    
dwON
}; 
Then, I've created an array :

PHP код:
new PlayerInfo[MAX_PLAYERS][pInfo]; 
After that, I've created some command, wich will turn the enum on, for example(my own command)

PHP код:
        if (strcmp("/dwall"cmdtexttrue10) == 0)
{
        for(new 
0MAX_PLAYERSi++)
            if(
IsPlayerConnected(i))
                {
                    
SendClientMessage(iCOLOR_BLUE"Admin has warped everyone to D-W map");
                    
PlayerInfo[i][dwON] = 1;
                    
SetWorldTime(8);
                    if(
gTeam[i] == TEAM_CT)
                        {
                        
SetPlayerArmour(i,100);
                        
SetPlayerHealth(i,100);
                        
SetPlayerPos(i165.781690.75 17.64);
                        
GivePlayerWeapon(playerid24100);
                        
GivePlayerWeapon(playerid163);
                        
GivePlayerWeapon(playerid31300);
                        
GivePlayerWeapon(playerid29150);
                        }
                        else if(
gTeam[i] == TEAM_T)
                        {
                        
SetPlayerArmour(i,100);
                        
SetPlayerHealth(i,100);
                        
SetPlayerPos(i159.331721.9417.64);
                        
GivePlayerWeapon(playerid24100);
                        
GivePlayerWeapon(playerid163);
                        
GivePlayerWeapon(playerid31300);
                        
GivePlayerWeapon(playerid29150);
                        }
                    }
                } 
Nobody knows for what I've done it right?
I've done it to make an If command, wich checks if dwON == 1 - Then I can do something with it, so in my situation, I gone to OnPlayerSpawn and added :

PHP код:
    if(PlayerInfo[playerid][dwON] == 1)
            {
                  if(
gTeam[playerid] == TEAM_CT)
                        {
                        
SetPlayerArmour(playerid,100);
                        
SetPlayerHealth(playerid,100);
                        
SetPlayerPos(playerid165.781690.75 17.64);
                        
GivePlayerWeapon(playerid24100);
                        
GivePlayerWeapon(playerid163);
                        
GivePlayerWeapon(playerid31300);
                        
GivePlayerWeapon(playerid29150);
                        }
                        else if(
gTeam[playerid] == TEAM_T)
                        {
                        
SetPlayerArmour(playerid,100);
                        
SetPlayerHealth(playerid,100);
                        
SetPlayerPos(playerid159.331721.9417.64);
                        
GivePlayerWeapon(playerid24100);
                        
GivePlayerWeapon(playerid163);
                        
GivePlayerWeapon(playerid31300);
                        
GivePlayerWeapon(playerid29150);
     }
     }

And now, when I wanted to play as regular, I've created this :


PHP код:
    if(strcmp("/dwalloff"cmdtexttrue10) == 0)
        {
            for(new 
0MAX_PLAYERSi++)
            
PlayerInfo[i][dwON] = 0;
            return 
1;
        } 
I hope it helps someone, atleast it helped to me, and I wanted to share it with you so another people wich have the same problem can get it solved here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)