help please
#1

help T.T

pawn Код:
InVehicle[playerid] = GetPlayerVehicleID(playerid);
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(vInfo[InVehicle[playerid]][vOwner] == pName) // THIS 1
        {
            SendClientMessage(playerid, COLOR_ADMIN, "PROBANDO CON DUEСO");
        }
        if(vInfo[InVehicle[playerid]][vOwner] == NoOwner) // THIS 2
        {
            SendClientMessage(playerid, COLOR_ADMIN, "PROBANDO SIN DUEСO");
        }
       
    }
error

error 033: array must be indexed (variable "pName") THIS 1
error 017: undefined symbol "NoOwner" THIS 2

HELP ME PLEASE y.y
Reply
#2

Youve not defined "NoOwner"
Reply
#3

Change "NoOwner" to "0" and make it so if someone buys a vehicle it will set "[vOwner] to 1"
Reply
#4

Not that I am wrong, but all vehicles now also the server I get the message PROBANDO SIN DUEСO :c

pawn Код:
enum VehicleInfo
{
    VID,
    model,
    vOwner,
    vOwnerName,
    Float:SpawnPos[4],
    Lock,
    vcolor1,
    vcolor2,
    carro
};

new vInfo[MAX_VEHICLES][VehicleInfo];
new vehid;
new InVehicle[MAX_PLAYERS];

new bool:validcar[MAX_VEHICLES];

stock GetFreeVehicleSlot()
{
    for(new i = 0; i < sizeof(validcar); i ++)
    {
        if(!validcar[i]) return i;
    }
    return -1;
}

CMD:vehicle(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] >=1 || IsPlayerAdmin(playerid))
    {
        vehid = GetFreeVehicleSlot();
        new car;
        new string[128];
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        if(sscanf(params,"i", car)) return SendClientMessage(playerid,0xff0000ff,"USAGE: /Veh <Vehicle ID 400 - 611>");

        vInfo[vehid][VID] = vehid;
        vInfo[vehid][model] = car;
        vInfo[vehid][vOwner] = 0;
        vInfo[vehid][vOwnerName] = 0;
        vInfo[vehid][SpawnPos][0] = X;
        vInfo[vehid][SpawnPos][1] = Y;
        vInfo[vehid][SpawnPos][2] = Z;
        vInfo[vehid][SpawnPos][3] = 90.0;
        vInfo[vehid][vcolor1] = 0;
        vInfo[vehid][vcolor2] = 0;
        validcar[vehid] = true;
       
            vInfo[vehid][carro] = CreateVehicle(car, X + 2, Y, Z, 90, vInfo[vehid][vcolor1], vInfo[vehid][vcolor2], 999);
            format(string,sizeof(string),"You Have Spawned Vehicle ID %i",car);
            SendClientMessage(playerid, 0xffffffff, string);
//          PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
    }
    return 1;
}
Reply
#5

Try this:

pawn Код:
enum VehicleInfo
{
    VID,
    model,
    vOwned,
    vOwner,
    Float:SpawnPos[4],
    Lock,
    vcolor1,
    vcolor2,
    carro
};
//=========================================//
    InVehicle[playerid] = GetPlayerVehicleID(playerid);
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(newstate == PLAYER_STATE_DRIVER)
    {
    if(vInfo[InVehicle[playerid]][vOwned] == 0)
    {
    SendClientMessage(playerid, COLOR_ADMIN, "PROBANDO SIN DUEN~O");
    }
    else if(vInfo[InVehicle[playerid]][vOwned] == 1)
    {
    if(strcmp(pName, vInfo[InVehicle[playerid]][vOwner], true))
    {
    SendClientMessage(playerid, COLOR_ADMIN, "PROBANDO CON DUEN~O");
    }
    }
    }
Reply
#6

That does not happen, but in all vehicles also get the message server PROBANDO SIN DUEСO, should go only to those who believe with the command u.u help me :c
Reply
#7

Are you the owner of that vehicle ?
Reply
#8

no, I think the vehicle, and is created without any owner, to solve this I do so you can buy the car that I believe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)