help please - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help please (
/showthread.php?tid=479237)
help please -
Cerealguy - 03.12.2013
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
Re: help please -
Mitchy - 03.12.2013
Youve not defined "NoOwner"
Re: help please -
Blademaster680 - 03.12.2013
Change "NoOwner" to "0" and make it so if someone buys a vehicle it will set "[vOwner] to 1"
Respuesta: help please -
Cerealguy - 04.12.2013
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;
}
Re: help please -
Areax - 04.12.2013
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");
}
}
}
Respuesta: help please -
Cerealguy - 04.12.2013
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
Re: help please -
Areax - 04.12.2013
Are you the owner of that vehicle ?
Respuesta: help please -
Cerealguy - 04.12.2013
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