Errors[rep]
#1

hi i added more origins.


PHP код:
new otext[21];
            (
29393) >> if[PlayerInfo][pOrigin] == 1) { otext "Romania"; } 
PHP код:
Errors:
(
29393) : error 029invalid expressionassumed zero
(29393) : warning 215expression has no effect
(29393) : error 001expected token";"but found "]"
(29393) : error 029invalid expressionassumed zero
(29393) : fatal error 107too many error messages on one line 
Reply
#2

pawn Код:
if([PlayerInfo][pOrigin] == 1) { otext = "Romania"; }
But why PlayerInfo into []?
Reply
#3

PHP код:
if([PlayerInfo][pOrigin] == 1) { otext "Romania"; }  if it's like this ..same errors.. 
Reply
#4

Post normal. I can't understand by like this, if like this.
The PlayerInfo is variable, isn't it? If yes, then you shouldn't use it inside [ ].
Is it for MAX_PLAYERS?
Reply
#5

so how should it be??
Reply
#6

This is what I am asking you?
Do you have for example:
pawn Код:
enum pInfo
{
    // More
    pOrigin,
    // Rest
}
new PlayerInfo[MAX_PLAYERS][pInfo];
If the pOrigin is in your enum you are using then you have to use it like this
pawn Код:
if( PlayerInfo[ playerid ][ pOrigin ] == 1 ) { otext = "Romania"; }
Reply
#7

There is exactly everything right with this line:

pawn Код:
if(PlayerInfo[playerid][pOrigin]==1) { otext = "Romania"; }
Otherwise, maybe THIS is 'causing problems?

pawn Код:
{ otext = "Romania"; }
Reply
#8

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Otherwise, maybe THIS is 'causing problems?

pawn Код:
{ otext = "Romania"; }
That ain't it, I use a method like this as a stock to get a player's rank by an integer and return a string
pawn Код:
stock GetPlayerRank(playerid)
{
    new rank[30];
    switch(pInfo[playerid][pFaction])
    {
        case 1:
        {
            switch(pInfo[playerid][pRank])
            {
                case 0: rank = "Probie";
                case 1: rank = "EMT";
                case 2: rank = "Paramedic";
                case 3: rank = "Firefighter";
                case 4: rank = "Lieutenant";
                case 5: rank = "Chief";
            }
        }
        case 2:
        {
            switch(pInfo[playerid][pRank])
            {
                case 0: rank = "Explorer";
                case 1: rank = "Trainee";
                case 2: rank = "Deputy";
                case 3: rank = "Detective";
                case 4: rank = "Commissioner";
                case 5: rank = "Sheriff";
            }
        }
    }
    return rank;
}
and it works 100 percent.

Try this Dan, those brackets are redundant.
pawn Код:
if(PlayerInfo[playerid][pOrigin]==1) otext = "Romania";
Reply
#9

Fiexed 1 problem.) but where do i edit so if i disconnect from server and enter again i want the person to respawn from where he disconnected..where do i edit what i have to do?
Reply
#10

please help with 2 second problem pleaseee
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)