I wanted to copy and paste the trunk system onto my gamemode but for some reason it wont let me when i try to compile it says pawn compiler library has stopped working thing about my GM it hasnt got admin duty thing and i want to copy it from ravens GM so can some one tell me the stuff i need to delete or add ?
check this and tell me what needs to be done so it will work with my GM :P
So you are trying to copy the trunk system to your own server. Well, have you also copied all the variables and functions like IsAnAmbulance(carid); for example .....
Why don't you script your own trunk system? If you can't script, don't run a server!
Nub shut up am tryin to learn :L my friends can script so am good dont tell me what i can or cant do :L and thanks Kastra ill try it :P
pawn Код:
//put those at the top of OnGamemodeInit
new VTrunk[MAX_VEHICLES];
forward Float:GetXYBehindCar(vid, &Float:q, &Float:w, Float:distance);
Float:GetXYBehindCar(vid, &Float:q, &Float:w, Float:distance)
{
new Float:a;
GetVehiclePos(vid, q, w, a);
GetVehicleZAngle(vid, a);
q += (distance * -floatsin(-a, degrees));
w += (distance * -floatcos(-a, degrees));
return a;
}
//put this in OnPlayerCommandText
if (strcmp(cmd, "/trunk", true, 10) == 0)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new vid; vid<MAX_VEHICLES; vid++)
{
new Float: vx, Float:vy, Float:vz;
GetVehiclePos(vid,vx,vy,vz);
GetXYBehindCar(vid, vx, vy, 3.5);
if(IsPlayerInRangeOfPoint(playerid,2.5,vx,vy,vz))
{
new e,l,a,d,b,bo,o;
GetVehicleParamsEx(vid,e,l,a,d,b,bo,o);
switch(VTrunk[vid])
{
case 0:
{
GetPlayerPos(playerid,px[playerid],py[playerid],pz[playerid]);
SetVehicleParamsEx(vid,e,l,a,d,b,1,o);
VTrunk[vid]=1;
new lockmsg[256];
format(lockmsg,sizeof(lockmsg),"* %s has opened the trunk of their vehicle.",name);
for(new Player; Player < MAX_PLAYERS; Player++)
{
if(IsPlayerInRangeOfPoint(Player,15,px[playerid],py[playerid],pz[playerid]))
{
SendClientMessage(Player,0xC2A2DAAA,lockmsg);
}
}
}
case 1:
{
GetPlayerPos(playerid,px[playerid],py[playerid],pz[playerid]);
SetVehicleParamsEx(vid,e,l,a,d,b,0,o);
VTrunk[vid]=0;
new lockmsg[256];
format(lockmsg,sizeof(lockmsg),"* %s has closed the trunk of their vehicle.",name);
for(new Player; Player < MAX_PLAYERS; Player++)
{
if(IsPlayerInRangeOfPoint(Player,15,px[playerid],py[playerid],pz[playerid]))
{
SendClientMessage(Player,0xC2A2DAAA,lockmsg);
}
}
}
}
}
}
return 1;
}