Problem with '?'.
#1

I receive many errors, the code is in a loop.

Код HTML:
if(IsPlayerConnected(ReturnUser(name)) ? (format(str, sizeof(str), "Online.")) : (format(str, sizeof(str), "Offline.")))
Код HTML:
undefined symbol "FormatNumber"
undefined symbol "FormatNumber"
undefined symbol "GiveMoney"
...etc
Reply
#2

first of all, you shouldnt use format like that, use str = "Offline." and str = "Online."
You should only use format if there is anythign that u want to put into the string like another variable.
And also you should give us your errors, that would be helpful
Reply
#3

so it seems like you are trying to use non existant functions?
Reply
#4

The errors you showed have nothing to do with the line of code that you've put on here. Show us the lines where the errors occur, you might have mistyped the function or you forgot a bracket (assuming that you even have the function defined).
Reply
#5

Код HTML:
for(new i = 0; i < cache_num_rows(); i++)
{
    if(IsPlayerConnected(ReturnUser(name)) ? (format(str, sizeof(str), "%s", name)) : (format(str, sizeof(str), "%d", rank)))
}
Receive many errors:
Код HTML:
\include\sscanf2.inc(149) : warning 219: local variable "i" shadows a variable at a preceding level
\include\sscanf2.inc(193) : warning 219: local variable "i" shadows a variable at a preceding level
\include\mSelection.inc(656) : warning 219: local variable "i" shadows a variable at a preceding level
\GM.pwn(1657) : warning 219: local variable "i" shadows a variable at a preceding level
\GM.pwn(1791) : error 017: undefined symbol "GetPlayerSpeed"
\GM.pwn(1785) : error 017: undefined symbol "GetName"
.........and so on.........
If I remove the line:
Код HTML:
if(IsPlayerConnected(ReturnUser(name)) ? (format(str, sizeof(str), "%s", name)) : (format(str, sizeof(str), "%d", rank)))
everything works correctly.
Reply
#6

In which function are you running these?
Reply
#7

PHP код:
if(IsPlayerConnected(ReturnUser(name)) ? (format(strsizeof(str), "%s"name)) : (format(strsizeof(str), "%d"rank)) 
try that
Reply
#8

Ah dude... What u doing?

My variant:
PHP код:
format(strsizeof strIsPlayerConnected(ReturnUser(name)) ? ("Online.") : ("Offline.")/*, arguments... (if you need)*/); 
Reply
#9

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
PHP код:
if(IsPlayerConnected(ReturnUser(name)) ? (format(strsizeof(str), "%s"name)) : (format(strsizeof(str), "%d"rank)) 
try that
What is the difference?
Not work.
Reply
#10

Quote:
Originally Posted by VVWVV
Посмотреть сообщение
Ah dude... What u doing?

My variant:
PHP код:
format(strsizeof strIsPlayerConnected(ReturnUser(name) ? ("Online.") : ("Offline.")); 
Not work.
Код HTML:
\GM.pwn(8403) : error 035: argument type mismatch (argument 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)