undefined simbol
#1

Код:
new rand = random(3000) + 1500;
new string[24];
format(string, sizeof(string), "{D20000}BG-{FFFFFF}%d", rand);
SetVehicleNumberPlate(vehicleid, string);
erros
Код:
Undefined Simbol vehicleid
i add something
Reply
#2

Test it, and tell me.

Код:
new rand = random(3000) + 1500, vehicleid = GetPlayerVehicleID(playerid);
new string[24];
format(string, sizeof(string), "{D20000}BG-{FFFFFF}%d", rand);
SetVehicleNumberPlate(vehicleid, string);
Reply
#3

NOW playerid error
Reply
#4

Show me all your scripts relating to this function of yours.
Reply
#5

Код:
public OnGameModeInit()
{
SetGameModeText("BA:RP V.0.1.0");
new rand = random(3000) + 1500, vehicleid = GetPlayerVehicleID(playerid);
new string[24];
format(string, sizeof(string), "{D20000}BG-{FFFFFF}%d", rand);
SetVehicleNumberPlate(vehicleid, string);
return 1;
}
Reply
#6

OnGameModeInIt doesn't have a playerid paramater.

Try using it under OnPlayerConnect(playerid)?
Reply
#7

Quote:
Originally Posted by FreAkeD
Посмотреть сообщение
OnGameModeInIt doesn't have a playerid paramater.

Try using it under OnPlayerConnect(playerid)?
how player will have vehicle on his connect D: ?

after creating your vehicles add this code
PHP код:
native IsValidVehicle(vehicleid); // <- add this after a_samp include
for(new 0MAX_VEHICLESi++)
{
    if(!
IsValidVehicle(i)) continue;
    new 
rand random(3000) + 1500;
    new 
string[24];
    
format(stringsizeof(string), "{D20000}BG-{FFFFFF}%d"rand);
    
SetVehicleNumberPlate(istring);

Reply
#8

tnx jlait it work i use so much rep i wil rep you tommorow
Reply
#9

Quote:
Originally Posted by jlalt
Посмотреть сообщение
how player will have vehicle on his connect D: ?

after creating your vehicles add this code
PHP код:
native IsValidVehicle(vehicleid); // <- add this after a_samp include
for(new 0MAX_VEHICLESi++)
{
    if(!
IsValidVehicle(i)) continue;
    new 
rand random(3000) + 1500;
    new 
string[24];
    
format(stringsizeof(string), "{D20000}BG-{FFFFFF}%d"rand);
    
SetVehicleNumberPlate(istring);

MAX_VEHICLES is 2000 by default. If he only has like 200 cars, it will continue looping for 1800 times for no reason.
You should use GetVehiclePoolSize instead, especially since it's under OnGameModeInit, so there will be no empty loops.

Код:
for (new i, j = GetVehiclePoolSize(); i <= j; i++)
Reply
#10

Something EVERYONE forgets, is to respawn the car once it has its plate set, otherwise you won't see it anyway.

Код:
    SetVehicleNumberPlate(i, string);
    SetVehicleToRespawn(i);
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)