SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 10/04/2017, 04:26 PM   #401
Oxygenated
Little Clucker
 
Oxygenated's Avatar
 
Join Date: Dec 2016
Posts: 29
Reputation: 2
Unhappy This is what i've done for now

Sir i really apologise that you are facing a little trouble while guiding me, indeed i am new to scripting all i just want to tell you that this is what i've done for now.
Code:
   
#include<a_samp>
#include<colandreas>

public OnFilterScriptInit()
{
	// Add any remove buildings (This only works once)
	CA_RemoveBuilding();
	
	// Initialize the collision world (This creates San Andreas, the entire map, excluding removed buildings)
	CA_Init();
	
	// Create objects
	CA_CreateDynamicObject_SC();

	return 1;
}
And again Sir a complete installation instructions will be highly appreciated. Once again i deeply regret for the problem that i am providing to you right now. Thanks!
__________________
Trying hard to get something new.

Last edited by Oxygenated; 10/04/2017 at 04:57 PM.
Oxygenated is offline   Reply With Quote
Old 22/04/2017, 10:03 PM   #402
CJ101
High-roller
 
CJ101's Avatar
 
Join Date: Jan 2008
Location: RevolutionX
Posts: 1,915
Reputation: 162
Default Re: ColAndreas - Collision Detection

For some reason the function CA_FindZ_For2DCoord(x,y,z); is not returning the ground Z level - its returning where the player IS.

Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_NO))
    {
        if(IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 520) return 1;
        if(Players[playerid][carpetwait] == true) return GameTextForPlayer(playerid,"~r~Reloading...",800,3);
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        CA_FindZ_For2DCoord(x,y,z);
        CreateExplosion(x,y,z,11,3);
        CreateExplosion(x+3,y,z,11,3);
        CreateExplosion(x+6,y,z,11,3);
        CreateExplosion(x+8,y,z,11,3);
        Players[playerid][carpetwait] = true;
        SetTimerEx("CarpetAgain",12000,0,"d",playerid);
       
        new kill;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i,3,x,y,z))
            {
                SetPlayerHealth(i,0);
                kill++;
            }
        }
        if(kill > 0)
        {
            format(xstring,sizeof xstring,"[*&*] Your airstike got you %d kills!",kill);
            SendClientMessage(playerid,COLOR_YELLOW,xstring);
            SetPlayerScore(playerid,Players[playerid][Kills] + kill);
            Players[playerid][Kills] += kill;
        }
    }
    return 1;
}
__________________

Desert Storm SA-MP TDM
HTTP://DESERTSTORM-SAMP.COM

CJ101 is offline   Reply With Quote
Old 23/04/2017, 02:16 AM   #403
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,261
Reputation: 1137
Default Re: ColAndreas - Collision Detection

You are not checking if any collision is found!

Code:
cell AMX_NATIVE_CALL ColAndreasNatives::CA_RayCastLine(AMX *amx, cell *params)
{
	cell* addr[3];

	// Adding a small value prevents a potential crash if all values are the same
	btVector3 Start = btVector3(btScalar(amx_ctof(params[1]) + 0.00001), btScalar(amx_ctof(params[2]) + 0.00001), btScalar(amx_ctof(params[3]) + 0.00001));
	btVector3 End = btVector3(btScalar(amx_ctof(params[4])), btScalar(amx_ctof(params[5])), btScalar(amx_ctof(params[6])));
	btVector3 Result;
	uint16_t Model = 0;

	if (collisionWorld->performRayTest(Start, End, Result, Model))
	{
		//Get our adderesses for the last 3
		amx_GetAddr(amx, params[7], &addr[0]);
		amx_GetAddr(amx, params[8], &addr[1]);
		amx_GetAddr(amx, params[9], &addr[2]);

		*addr[0] = amx_ftoc(Result.getX());
		*addr[1] = amx_ftoc(Result.getY());
		*addr[2] = amx_ftoc(Result.getZ());

		return Model;
	}
	return 0;
}
If the raytest fails then your input x, y, z values remain the same.
Pottus is offline   Reply With Quote
Old 23/04/2017, 04:51 AM   #404
CJ101
High-roller
 
CJ101's Avatar
 
Join Date: Jan 2008
Location: RevolutionX
Posts: 1,915
Reputation: 162
Default Re: ColAndreas - Collision Detection

@Pottus:

I'm getting some errors.

Code:
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2026) : error 010: invalid function or declaration
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2031) : error 010: invalid function or declaration
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2036) : error 010: invalid function or declaration
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2039) : error 067: variable cannot be both a reference and an array (variable "addr")
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2040) : error 025: function heading differs from prototype
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2041) : error 025: function heading differs from prototype
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2043) : error 010: invalid function or declaration
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2047) : error 010: invalid function or declaration
C:\Users\Justin\Documents\rxdm\gamemodes\war.pwn(2049) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase
__________________

Desert Storm SA-MP TDM
HTTP://DESERTSTORM-SAMP.COM


Last edited by CJ101; 23/04/2017 at 08:53 PM.
CJ101 is offline   Reply With Quote
Old 26/06/2017, 08:08 AM   #405
Matthew57
Banned
 
Join Date: May 2017
Posts: 62
Reputation: 7
Default Re: ColAndreas - Collision Detection

Hello, your Plugin isn't working it's giving me error Please help!
09:52:44] Loading plugin: ColAndreas.so
[09:52:44] Failed (libBulletDynamics.so.2.83: cannot open shared object file: No such file or directory)
Matthew57 is offline   Reply With Quote
Old 26/06/2017, 09:04 AM   #406
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,106
Reputation: 128
Default Re: ColAndreas - Collision Detection

Quote:
Originally Posted by Matthew57 View Post
Hello, your Plugin isn't working it's giving me error Please help!
09:52:44] Loading plugin: ColAndreas.so
[09:52:44] Failed (libBulletDynamics.so.2.83: cannot open shared object file: No such file or directory)
One more person that didnt even bothered reading first post...You see if you did read you would know what to do, and you would't have to wait for a reply.

Use these version
__________________
Путин here,
Путин there,
Путин просто everywhere.


Any PM's that include question about any kind of help will be ignored.
Use appropriate boards for that
DRIFT_HUNTER is offline   Reply With Quote
Old 02/07/2017, 03:19 PM   #407
ranme15
Big Clucker
 
ranme15's Avatar
 
Join Date: Aug 2010
Posts: 164
Reputation: 3
Default Re: ColAndreas - Collision Detection

Why am I getting "Pawno has stopped working.." whenever I try compiling with #include <colandreas>?
Those are my includes:
Code:
#include <a_samp>
#include <a_mysql>
#include <xml>
#include <streamer>
#include <colandreas>
#include <supporter>
#include <timerfix>
#include <sscanf2>
#include <Pawn.CMD>
#include <crashdetect>
#include <dialogs>
#include <log-plugin>
#include <YSF>
__________________
INACTIVE

Last edited by ranme15; 02/07/2017 at 04:14 PM.
ranme15 is offline   Reply With Quote
Old 23/07/2017, 02:54 PM   #408
Amads
Big Clucker
 
Amads's Avatar
 
Join Date: Feb 2012
Location: Poland
Posts: 172
Reputation: 28
Default Re: ColAndreas - Collision Detection

Allright, this is going to be weird.
Using colandreas_static.so CA_Init(); freezes my linux server. BUT it doesn't freeze if StrickenKid's MySQL plugin is loaded. I have no idea what's the connection between the two, but it's the only way to run ColAndreas for me.
http://forum.sa-mp.com/showpost.php?...8&postcount=10
Amads is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] ColAndreas - (Released) Pottus Plugin Development 415 19/08/2015 12:31 AM
No veh collision vs vehicles with collision issue Kar 0.3.7 RC Scripting 5 10/05/2015 11:08 PM
ColAndreas Pottus Screenshots and Videos 73 17/12/2014 08:32 PM
Collision Detection (Plugin) Deduction Scripting Help 0 27/12/2013 04:24 AM
Collision Detection? NumbSkull Scripting Help 4 13/11/2012 03:27 AM


All times are GMT. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.