Help me please!! :(
#1

Hello, Somebody know how to compare ini values with loop? i use y_ini and i want that when a player enter on a car, gives a message like "This vehicle belongs to %s.." i make this code but doesn't work!! :C

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid... etc)
{
  for(new b = 0; b < sizeof(DVehicles); b++)
  {
    new pname[24], string[256];
    GetPlayerName(playerid, pname, 24);
    format(string,sizeof(string),"{FFFFFF}This vehicle belongs to %s", DVehicles[b][Owner]);
    SendClientMessage(playerid, -1, string);
  }


    return 1;
}
Enums of DVehicles
pawn Код:
enum vfInfo
{
    dID,
    dModel,  
    Float:dX,
    Float:dY,
    Float:dZ,
    Float:dA,
    dColor1,
    dColor2,
    Owner[24],
};
Reply
#2

Show enum DVehicles
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Show enum DVehicles
There is
Reply
#4

DVehicles too xd
Reply
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
DVehicles too xd
DVehicles is vfInfo,
pawn Код:
enum vfInfo
{
    dID,
    dModel,  
    Float:dX,
    Float:dY,
    Float:dZ,
    Float:dA,
    dColor1,
    dColor2,
    Owner[24],
};
new DVehicles[MAX_VEHICLES][vfInfo];//*******
Reply
#6

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid... etc)
{
    new pname[24];
    GetPlayerName(playerid, pname, 24);
    if( DVehicles[vehicleid][Owner][0] && strcmp(name,DVehicles[vehicleid][Owner]) ) // if vehicle is not yours
    {
        new string[60];
        format(string,sizeof(string),"{FFFFFF}This vehicle belongs to %s", DVehicles[vehicleid][Owner]);
        SendClientMessage(playerid, -1, string);
        return 1;
    }
    return 1;
}
Reply
#7

Doesn't work! :C Anyway thanks for attempt
Reply
#8

It works only when someone wants enter to your vehicle
Reply
#9

Quote:
Originally Posted by Jefff
Посмотреть сообщение
It works only when someone wants enter to your vehicle
OMG man i don't know what i do but it works!!! Thanks
Reply
#10

Quote:
Originally Posted by Alejandro041
Посмотреть сообщение
OMG man i don't know what i do but it works!!! Thanks
lol good for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)