View Vehicle not working properly
#1

Hi, I added "View Vehicle" to MDC in my gamemode recently along with license plate system. Each car has it's own license plate. Everything works fine except the View Vehicle thing. It works, but not properly. If I type in my car's license plate, it gives me the information of any other car, but when I type any other license plate then it shows the information of my car. I don't understand what am I doing wrong. Here's the code:
Код:
code removed, i don't want to release it :P
I'm using South Central Roleplay script, all functions are there.
Reply
#2

Hello!

PHP код:
if (strcmp(CarData[carid][carPlate], inputtext)) 
to
PHP код:
if (!strcmp(CarData[carid][carPlate], inputtext)) 
Does it work?
Reply
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

PHP код:
if (strcmp(CarData[carid][carPlate], inputtext)) 
to
PHP код:
if (!strcmp(CarData[carid][carPlate], inputtext)) 
Does it work?
Oh yeah, thank you. I thought that there must not be a "!".
Reply
#4

When strcmp returns 0 (so with "!") then the both strings are the same. When it's higher as 0 (without "!") then they are not the same.
Reply
#5

Quote:
Originally Posted by Mencent
Посмотреть сообщение
When strcmp returns 0 (so with "!") then the both strings are the same. When it's higher as 0 (without "!") then they are not the same.
Yep, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)