PDA

View Full Version : Trunk system


david1236
09/12/2010, 09:21 AM
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 ?

GooMan
09/12/2010, 09:36 AM
a bricket is missing^^

david1236
09/12/2010, 09:46 AM
:L a bracket? http://pastebin.com/59BBFXtx check this and tell me what needs to be done so it will work with my GM :P

Kastranova
09/12/2010, 01:58 PM
Hello,

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 .....

Scenario
09/12/2010, 02:08 PM
Why don't you script your own trunk system? If you can't script, don't run a server!

david1236
09/12/2010, 05:33 PM
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

Amora187
29/06/2012, 10:42 PM
Here is code:

//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;
}

Luis-
29/06/2012, 10:51 PM
Good god, use [ pawn] & [ /pawn] tags :|

Amora187
30/06/2012, 03:39 PM
I did, ask David1236 to see the code and will take it if he wants