Why get errors ?
#1

PHP код:
stock EngineColor(playerid) {
    new 
str[5];
    if(
EngineStatus[playerid] == 0)
        
format(strsizeof(str), "r");
    if(
EngineStatus[playerid] == 1)
        
format(strsizeof(str), "g");
    return 
str;

PHP код:
 error 029invalid expressionassumed zero
warning 215
expression has no effect
error 001
expected token";"but found "]"
error 029invalid expressionassumed zero
too many error messages on one line 
Reply
#2

The code you posted is correct. It is working for me.

Could you show us the lines where the errors are?
Reply
#3

pawn Код:
stock EngineColor(vid)
{
    new str[6];
    if(EngineStatus[playerid] == 0) str = "r";
    if(EngineStatus[playerid] == 1) str = "g";
    return str;
}
Reply
#4

What are you trying to do with that command ?
Reply
#5

All of the errors are on this line:
Quote:

if(EngineStatus[playerid] == 0)

I want to do a textdraw:
PHP код:
        format(strsizeof(str), "Engine: ~%s~%d \%"EngineColor(playerid), CarEngine[playerid]);
        
speedo4[playerid] = TextDrawCreate(470.0420.0" ");
        
TextDrawSetString(speedo4[playerid], str);
        
TextDrawSetShadow(speedo4[playerid], false);
        
TextDrawSetOutline(speedo4[playerid], 1);
        
TextDrawLetterSize(speedo4[playerid], TEXT_DRAW_X_FACTORTEXT_DRAW_Y_FACTOR);
        
TextDrawSetProportional(speedo4[playerid], 1);
        
TextDrawFont(speedo4[playerid], TEXT_DRAW_FONT);
        
TextDrawShowForPlayer(playeridspeedo4[playerid]); 
@Sawalha i have the same errors with your code
Reply
#6

you forgot "{"
if(EngineStatus[playerid] == 0)
{
format(str // etc..
}
if(EnginteStatus[playerid] == 1)
{
// etc etc
}
Reply
#7

Same erros
Reply
#8

Try my old code with str = "g"; and others, but chane EngineStatus(vid) to EngineStatus(playerid)
Reply
#9

this fucken pawno, i renamed the stock and it works
I dont have stocks with that name, dont know why
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)