06.05.2014, 09:36
(
Последний раз редактировалось superrobot48; 06.05.2014 в 10:16.
)
i read the tutorials
THis
and i cant get this function to work
. this function is to check how many cars the player have.
enum where vOwner is defined
the error:
PLEASE HELP GUYZ!
THis
and i cant get this function to work
. this function is to check how many cars the player have.
pawn Код:
GetPlayerVehicles(playerid)
{
new playername[24];
GetPlayerName(playerid, playername, sizeof(playername));
new count;
for(new i = 0; i < MAX_VEHICLES; i++) // For every vehicles till the maximum amount
{
if((vCreated[i] == true) && strcmp(VehicleInfo[i][vOwner],playername == 0))
{
count++;
}
}
return count;
}
pawn Код:
enum vInfo
{
vID, // The vehicle id used on the SA-MP to represent the vehicle.
vModel, // The vehicle model of the vehicle.
Float:xspawn,
Float:yspawn,
Float:zspawn,
Float:anglespawn, // The array which contains position and the rotation of the vehicle in 4 cells. So, basically {X = 0, Y = 1, Z = 2, R = 3}
vColor1, // The primary color of the vehicle.
vColor2, // The secondary color of the vehicle.
vOwner[MAX_PLAYER_NAME],
bombed, // The vehicle's owner name. Remember string is a group of literal characters and the cells you provide should be the maximum length for that string.
bool:vLocked // Bool representing if the vehicle is locked or not. (0 = False, 1 = True)
}
new VehicleInfo[MAX_VEHICLES][vInfo];
pawn Код:
E:\samp03x_svr_R2_win32\gamemodes\Untitled.pwn(4636) : error 033: array must be indexed (variable "playername")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.