06.12.2013, 15:41
i have made a /lock command to lock owned vehicles:
and the command:
and it shows me :error undefined symbol playerid about the public OnVehicleStreamIn(vehicleid, forplayerid)
so it doesnt lock it ingame how to define it?
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(PlayerInfo[playerid][LockedCar] == 1 || PlayerInfo[playerid][LockedCar2] == 1) LockCar(vehicleid);
else UnLockCar(vehicleid);
return 1;
}
pawn Код:
if(strcmp(cmd, "/lock", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new oldcar = gLastCar[playerid];
new Float:cx, Float:cy, Float:cz;
GetVehiclePos(oldcar, cx, cy, cz);
if(PlayerInfo[playerid][PlayerCarModel] == 0 || PlayerInfo[playerid][PlayerCarModel2] == 0)
{
SendClientMessage(playerid, COLOR_GREY," You dont own a vehicle.");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 4, PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]))
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger has locked their vehicle.");
else format(string, sizeof(string), "* %s has locked their vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED);
PlayerInfo[playerid][LockedCar] = 1;
}
if(IsPlayerInRangeOfPoint(playerid, 4, PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]))
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger has locked their vehicle.");
else format(string, sizeof(string), "* %s has locked their vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED);
PlayerInfo[playerid][LockedCar2] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are too far away from your vehicle !");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/unlock", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new oldcar = gLastCar[playerid];
new Float:cx, Float:cy, Float:cz;
GetVehiclePos(oldcar, cx, cy, cz);
if(PlayerInfo[playerid][PlayerCarModel] == 0 || PlayerInfo[playerid][PlayerCarModel2] == 0)
{
SendClientMessage(playerid, COLOR_GREY," You dont own a vehicle.");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 4, PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]))
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger has unlocked their vehicle.");
else format(string, sizeof(string), "* %s has unlocked their vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED);
PlayerInfo[playerid][LockedCar] = 0;
}
if(IsPlayerInRangeOfPoint(playerid, 4, PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]))
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger has unlocked their vehicle.");
else format(string, sizeof(string), "* %s has unlocked their vehicle.", sendername);
ProxDetector(30.0, playerid, string, COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED,COLOR_DARKRED);
PlayerInfo[playerid][LockedCar2] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are too far away from your vehicle !");
return 1;
}
}
return 1;
}
so it doesnt lock it ingame how to define it?