26.11.2011, 10:52
kk I just downloaded the LARP mode and had a look @ it's variables.
This should work e'z
This should work e'z
pawn Код:
if(strcmp(cmd, "/subwoofer", true == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new CurrentDriver[64];
new CurrentVehicle;
GetPlayerName(playerid, CurrentDriver, sizeof(CurrentDriver);
CurrentVehicle = GetPlayerVehicleID(playerid);
if(CarInfo[CurrentVehicle][cOwned] == 1)
{
if(strfind(CarInfo[CurrentVehicle][cOwner], CurrentDriver, true) != -1)
{
if(PlayerInfo[playerid][pSubwoofer])
{
if(!SubwooferCar[playerid])
{
SubwooferCar[playerid] = 1;
Sub[vid][0] = CreateObject(2232,0,0,0,0,0,0);
AttachObjectToVehicle(Sub[vid][0], vid, 0.025002, -1.729998, -0.020000, -74.369995, 87.133476, -3.015000);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s installs a subwoofer into the car", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SubwooferAutos[playerid] = 0;
DestroyObject(Sub[vid][0]);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s removes a subwoofer from the car", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "* You must buy subwoofer.");
}
return 1;
}
else
{
//This is where you place code affecting a player who doesnt own the car but tried to attatch a subwoofer
return 1;
}
}
else
{
//this is where you place code affecting a player trying to put a subwoofer in a non-owned car
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in the drivers seat of a car.");
}
}