I think my code is wrong.
#1

I've been tweeking this alot over the past hour, I've did it before, but I'm not sure if this is the same code I was using.

pawn Код:
for(new carid = 0; carid < CARS; carid++)
{
    if(DynamicCars[carid][CarType] == 1)
    {
         new string[11];
         SetVehicleParamsForPlayer(carid, playerid, 1, 0);
         format(string, sizeof(string), "%d", carid);
         SendClientMessage(playerid, COLOR_WHITE);
     }
}
I'll rep, if you're 'in need' of it.
Reply
#2

What are you trying to achieve?

What is wrong with the code? Why is it 'wrong'? does it not work? does it crash your server? does it not compile, if so what's the error?
Reply
#3

It complies. It just doesn't work ingame.
Reply
#4

Quote:
Originally Posted by EliteApple
Посмотреть сообщение
It complies. It just doesn't work ingame.
Does it send empty strings? (You could see with timestamp on. Else just put "> " in front of %d or something, then you're 100% sure.) Else it'll be in the if check, make sure 'DynamicCars[carid][CarType]' is actually 1 else it will indeed do nothing.

Best regards,
Jesse
Reply
#5

helps if you send the string
SendClientMessage(playerid, COLOR_WHITE);
SendClientMessage(playerid, COLOR_WHITE, string);
Reply
#6

Quote:
Originally Posted by DeStunter
Посмотреть сообщение
helps if you send the string
SendClientMessage(playerid, COLOR_WHITE);
SendClientMessage(playerid, COLOR_WHITE, string);
OH LOL! I just read "SendClientMessage", never even check the params because that's too obvious :3...... Anyhow, can happen, nothing to worry about, alltough Pawno should give you a warning telling you that the parameters aren't right and that should be enough info to find out what's wrong. But hey, it's solved ..

Best regards,
Jesse
Reply
#7

Thats the thing, I don't even get that message. When I do indeed have 4 cars with type 1.



EDIT: Okay, now it sends me the vehicle IDs that are type 1, but still, type 1 vehicles do not get unlocked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)