[Plugin] Streamer Plugin

Quote:
Originally Posted by Reynolds
Посмотреть сообщение
Hello, I use this code to generate a random checkpoint from an SQL table:

Код:
RandomGenerateCP(playerid)
{
	new result[150], Float:x, Float:y, Float:z, streetname[50];
	mysql_query( "SELECT * FROM  `streetcorners` ORDER BY RAND( ) LIMIT 1;" );
	mysql_store_result();

	if(mysql_fetch_row_format(result))
	{
		sscanf( result, "p<|>{i}fffs[50]", x, y, z, streetname );
		DestroyDynamicRaceCP(MissionCPMapicon[playerid][0]);
		DestroyDynamicMapIcon(MissionCPMapicon[playerid][1]);
        MissionCPMapicon[playerid][0] = CreateDynamicRaceCP(2, x, y, z, -2000.0, 2000.0, 0.0, 3.0, _, _, playerid );
        MissionCPMapicon[playerid][1] = CreateDynamicMapIcon(x, y, z, 0, 0xFF0000FF, _, _, playerid, 2000.0, MAPICON_GLOBAL);
	}
	mysql_free_result();
	return streetname;
}
Unfortunately, whenever this script runs with two or more players, their checkpoints (and sometimes their mapicons) seem to get destroyed as well.

For example: RandomGenerateCP(1) gets called when player #1 does some action. At the same time, all the other players who got a CP using this function have their CPs removed. What can be done to prevent this or what am I doing wrong?
It may be because if this code runs the first time, the array MissionCPMapicon[playerid] contains 0 (index 0 and 1), so it will always destroy the first ids of the mapicons and cps.

When creating the array just set all indexes to -1 and put "IsValidDynamicMapIcon" / "IsValidDynamicRaceCP" checks before destroying them.
Reply

I think there is a bug with the plugin. When I try removing player objects (CreatePlayerObject) , sometimes, it removes the dynamic objects, too. Any idea ?
Reply

Quote:
Originally Posted by fordawinzz
Посмотреть сообщение
I think there is a bug with the plugin. When I try removing player objects (CreatePlayerObject) , sometimes, it removes the dynamic objects, too. Any idea ?
Yes, this streamer uses PlayerObjects for streaming, so if you remove a player object, it may be a streamer one.
Reply

shouldn't it be createdynamicobject ?
Reply

this plugin should have a wiki page

i a little bit confused with the CreateDynamicRaceCP. Especially on making the last race CP
Reply

Quote:
Originally Posted by NaS
Посмотреть сообщение
Yes, this streamer uses PlayerObjects for streaming, so if you remove a player object, it may be a streamer one.
Ok, when I use CreateDynamicObject and I set the playerid parameter for a player, the objects IDs are 'switching', I mean it sets a checkpoint to another object then it should be...

The objects are used for mow lawn job and the lumberjack job. When I cut the whole trees, I delete them. I do the same for mow lawner. For some players the mow lawn checkpoint is set to a tree position. I hope you understand what I say.
Reply

Quote:
Originally Posted by fordawinzz
Посмотреть сообщение
Ok, when I use CreateDynamicObject and I set the playerid parameter for a player, the objects IDs are 'switching', I mean it sets a checkpoint to another object then it should be...

The objects are used for mow lawn job and the lumberjack job. When I cut the whole trees, I delete them. I do the same for mow lawner. For some players the mow lawn checkpoint is set to a tree position. I hope you understand what I say.
That shouldnt happen, if you do not touch any Player Objects.
Reply

I didn't, I switch from CreatePlayerObject to CreateDynamicObject using the playerid parameter.
Reply

how to fix the following error?.

pawn Код:
[20:50:28] *** Streamer Plugin: Warning: Include file version (0x26105) does not match plugin version (0x27201) (script might need to be recompiled with the latest include file)
Reply

Quote:
Originally Posted by OTACON
Посмотреть сообщение
how to fix the following error?.

pawn Код:
[20:50:28] *** Streamer Plugin: Warning: Include file version (0x26105) does not match plugin version (0x27201) (script might need to be recompiled with the latest include file)
The plugin does not include only a .dll (for Windows) or .so (for Linux) file in the server/plugins folder,it also includes a streamer.inc file in server/pawno.include folder,so you need to update it too.That is the problem I think.
Reply

Tip: In the next versions create callbacks as

pawn Код:
public OnObjectStreamPlayerIn(objectid, playerid) {

}
pawn Код:
public OnObjectStreamPlayerOut(objectid, playerid) {

}

Thank you! This is the best streamer to SAMP.
Reply

i have seemed to hit a bug.

i had around 13 checkpoints streaming and working perfectly.

as soon as i got up to 20 checkpoints, whenever i added a new checkpoint, an old one would stop working.

the old checkpoint would still stream but nothing would happen when i entered it.

adding another checkpoint would just make an older one stop working.

any idea to what may be wrong?

here is my code:

TOP:

Code:
#include <a_samp>
#include <core>
#include <float>
#include <streamer>
#include <damm>
#include <fixes>


new Checkpoint [MAX_PLAYERS];
AT OnPlayerSpawn

Code:
Checkpoint[0] = CreateDynamicCP(-2112.7422,-753.4459,32.1719, 2, -1, -1, -1, 10); // Enter Store //
Checkpoint[1] = CreateDynamicCP(-2112.7422,-753.4459,32.1719, 2, -1, -1, -1, 10); // Exit Store //
Checkpoint[2] = CreateDynamicCP(295.7549,-38.3972,1001.5156, 2, -1, 1, -1, 10); // Ammunation Dialog Market //
Checkpoint[3] = CreateDynamicCP(1939.9860,-1771.2769,13.3906, 2, -1, 0, -1, 10); // Petrol Idlewood //
Checkpoint[4] = CreateDynamicCP(1685.8761,-2335.4973,13.5469, 2, -1, 0, -1, 10); // Airways Entrance //
Checkpoint[5] = CreateDynamicCP(315.7267,1026.2152,1949.4008, 2, -1, 9, -1, 10); // Skydive Dialog //
Checkpoint[6] = CreateDynamicCP(315.8065,972.7241,1961.7169, 2, -1, 9, -1, 10); // Airways Exit //
Checkpoint[7] = CreateDynamicCP(2027.6025,-1406.3354,17.2111, 2, -1, 0, -1, 10); // Hospital Jefferson //
Checkpoint[8] = CreateDynamicCP(1172.0770,-1323.4292,15.4032, 2, -1, 0, -1, 10); // Hospital Market //
Checkpoint[9] = CreateDynamicCP(1001.0299,-935.4196,42.1797, 2, -1, 0, -1, 10); // Petrol Mulholland //
Checkpoint[10] = CreateDynamicCP(657.5551,-570.3030,16.3359, 2, -1, 0, -1, 10); // Petrol Dillimore //
Checkpoint[11] = CreateDynamicCP(1383.7936,460.8412,20.0972, 2, -1, 0, -1, 10); // Petrol Montgomery //
Checkpoint[12] = CreateDynamicCP(-30.2348,-55.6318,1003.5469, 2, -1, 6, -1, 10); // 24/7 Commerce Dialog //
Checkpoint[13] = CreateDynamicCP(1368.6726,-1279.0184,13.5469, 1, -1, 0, -1, 10); // Ammunation Market Enter //
Checkpoint[14] = CreateDynamicCP(285.4913,-41.8041,1001.5156, 1, -1, 1, -1, 10); // Ammunation Market Exit //
Checkpoint[15] = CreateDynamicCP(1555.0160,-1675.0308,16.1953, 1, -1, 0, -1, 10); // LSPD Enter //
Checkpoint[16] = CreateDynamicCP(246.8640,62.3215,1003.6406, 1, -1, 6, -1, 10); // LSPD Exit //
Checkpoint[17] = CreateDynamicCP(1352.2979,-1759.2493,13.5078, 1, -1, 0, -1, 10); // 24 7 Commerce Enter //
Checkpoint[18] = CreateDynamicCP(-26.6681,-58.2642,1003.5469, 1, -1, 6, -1, 10); // 24 7 Commerce Exit //
Checkpoint[19] = CreateDynamicCP(2400.3748,-1981.9937,13.5469, 1, -1, 0, -1, 10); // Ammunation Willowfield Enter //
Checkpoint[20] = CreateDynamicCP(296.8109,-112.0679,1001.5156, 1, -1, 6, -1, 10); // Ammunation Willowfield Exit //
Checkpoint[21] = CreateDynamicCP(290.1359,-109.7811,1001.5156, 1, -1, 6, -1, 10); // Ammunation Willowfield Dialog //
Checkpoint[22] = CreateDynamicCP(1837.0398,-1682.3647,13.3228, 1, -1, 0, -1, 10); // Alhambra Enter //
Checkpoint[23] = CreateDynamicCP(493.5882,-24.9520,1000.6719, 1, -1, 17, -1, 10); // Alhambra Exit //
at OnPlayerEnterDynamicCP

Code:
{
	   if(checkpointid == Checkpoint[0]) // Enter Store
	   {
		  SetPlayerPos(playerid, 100, 100, 100);
		  SetPlayerInterior(playerid, 1);
       }
	   if(checkpointid == Checkpoint[1]) // Exit Store
	   {
		  SetPlayerPos(playerid, 100, 100, 100);
		  SetPlayerInterior(playerid, 0);
       }
	   if(checkpointid == Checkpoint[2]) // Ammunation Dialog Market
	   {
    	ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Ammunation Menu", "Baseball Bat\t\t$100\nSawn-Off Shotgun\t$2000\nCombat Shotgun\t$1000\nM4\t\t\t$2000\nMP5\t\t\t$1500\nAK-47\t\t\t$1500\nSniper Rifle\t\t$1500\nTec-9\t\t\t$1000\nArmour\t\t\t$500", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[3]) // Petrol Dialog Idlewood
	   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Petrol Station Menu", "Repair Vehicle\nAdd Nitrous\nMolotovs\t$1000", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[4]) // Airways LS Marker
	   {
	   switch(GetPlayerMoney(playerid) <1000)
	   {
	   case 1:
	   {
          SendClientMessage(playerid, -1, "A Minimum of $1000 is Required to Travel.");

       }
	   default:
       {
         SetPlayerPos(playerid, 315.7090,983.4100,1959.2788);
         SetPlayerFacingAngle(playerid, 180);
         SetPlayerInterior(playerid, 9);
         SendClientMessage(playerid, -1, "Welcome to OzzieCoq Airways.");

       }
       }
       }
	   if(checkpointid == Checkpoint[5]) // Skydive Dialog
	   {
       ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Skydive Menu", "Angel Pine\t\t$1000\nBayside\t\t$1000\nBlueberry\t\t$1000\nFort Carson\t\t$1000\nMontgomery\t\t$1000\nPalomino\t\t$1000\nVerdant Meadows\t$1000", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[6]) // Airways Exit
	   {
       SetPlayerPos(playerid, 1685.8247,-2330.1519,13.5469);
	   SetPlayerInterior(playerid, 0);
       SendClientMessage(playerid, -1, "You have left OzzieCoq Airways.");
       }
	   if(checkpointid == Checkpoint[7]) // Hospital Menu Jefferson
	   {
       ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Hospital Menu", "Heal\t\t\t\t$100\nCure STD/Snakebite\t\t$500\nAntibiotics\t\t\t$2000", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[8]) // Hospital Menu Market
	   {
       ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Hospital Menu", "Heal\t\t\t\t$100\nCure STD/Snakebite\t\t$500\nAntibiotics\t\t\t$2000", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[9]) // Petrol Dialog Mullholland
	   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Petrol Station Menu", "Repair Vehicle\nAdd Nitrous\nMolotovs\t$1000", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[10]) // Petrol Dialog Dillimore
	   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Petrol Station Menu", "Repair Vehicle\nAdd Nitrous\nMolotovs\t$1000", "Select", "Exit");//Show them the dialog.
       }
	   if(checkpointid == Checkpoint[11]) // Petrol Dialog Montgomery
	   {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Petrol Station Menu", "Repair Vehicle\nAdd Nitrous\nMolotovs\t$1000", "Select", "Exit");//Show them the dialog.
       }
       if(checkpointid == Checkpoint[12]) // 24/7 Commerce Shop
	   {
       ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "24/7 Shop Menu", "Cane\t\t\t$100\nChainsaw\t\t$1000\nHandgun\t\t$500\nFlowers\t\t$250\nCamera\t\t\t$500\nParachute\t\t$500\nRob the 24/7", "Select", "Exit");//Show them the dialog.
       }
       if(checkpointid == Checkpoint[13]) // Ammunation Market Enter
	   {
       SetPlayerPos(playerid, 287.2228,-39.6838,1001.5156);
       SetPlayerInterior(playerid, 1);
       }
       if(checkpointid == Checkpoint[14]) // Ammunation Market Exit
	   {
       SetPlayerPos(playerid, 1365.3500,-1279.0601,13.5469);
       SetPlayerInterior(playerid, 0);
       }
       if(checkpointid == Checkpoint[15]) // LSPD Enter
	   {
       SetPlayerPos(playerid, 246.7840,63.9002,1003.6406);
       SetPlayerInterior(playerid, 6);
       }
       if(checkpointid == Checkpoint[16]) // LSPD Exit
	   {
       SetPlayerPos(playerid, 1552.4471,-1674.9868,16.1953);
       SetPlayerInterior(playerid, 0);
       }
       if(checkpointid == Checkpoint[17]) // LSPD Enter
	   {
       SetPlayerPos(playerid, -26.6910,-55.7145,1003.5469);
       SetPlayerInterior(playerid, 6);
       }
       if(checkpointid == Checkpoint[18]) // LSPD Exit
	   {
       SetPlayerPos(playerid, 1352.3300,-1755.7100,13.3530);
       SetPlayerInterior(playerid, 0);
       }
       if(checkpointid == Checkpoint[19]) // Ammunation Willowfield Enter
	   {
       SetPlayerPos(playerid, 296.7698,-110.0871,1001.5156);
       SetPlayerInterior(playerid, 6);
       }
       if(checkpointid == Checkpoint[20]) // Ammunation Willowfield Exit
	   {
       SetPlayerPos(playerid, 2400.6975,-1979.7654,13.5469);
       SetPlayerInterior(playerid, 0);
       }
	   if(checkpointid == Checkpoint[21]) // Ammunation Dialog Market
	   {
    	ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Ammunation Menu", "Baseball Bat\t\t$100\nSawn-Off Shotgun\t$2000\nCombat Shotgun\t$1000\nM4\t\t\t$2000\nMP5\t\t\t$1500\nAK-47\t\t\t$1500\nSniper Rifle\t\t$1500\nTec-9\t\t\t$1000\nArmour\t\t\t$500", "Select", "Exit");//Show them the dialog.
       }
       if(checkpointid == Checkpoint[22]) // Alhambra Enter
	   {
       SetPlayerPos(playerid, 493.3910,-22.7228,1000.6797);
       SetPlayerInterior(playerid, 17);
       }
       if(checkpointid == Checkpoint[23]) // Alhambra Exit
	   {
       SetPlayerPos(playerid, 1834.2383,-1682.4645,13.4399);
       SetPlayerInterior(playerid, 0);
       }
Reply

I have problem with UpdateDynamic3DTextLabelText.
Code:
Label = CreateDynamic3DTextLabel(Text,COLOR_RED,x,y,z,50.0);
format(changetext,128,"Owner:%s",Owner);
UpdateDynamic3DTextLabelText(Label,COLOR_RED,changetext);
But ingame my label isnt updating.
Reply

Awesome, thanks!
Reply

I have problem, i created a 3dlabel (CreateDynamic3DTextLabel) and after 5 minutes dissapears... (only happens if created in game, and not when load the gamemode.)

some solution?
Reply

Yes i see it too. WHen i create it disapear.
Reply

Quote:
Originally Posted by BGTrucker
View Post
The plugin does not include only a .dll (for Windows) or .so (for Linux) file in the server/plugins folder,it also includes a streamer.inc file in server/pawno.include folder,so you need to update it too.That is the problem I think.
Same here... He didn't add the new .inc of the new version 2.7.3.0
Reply

Incognito will be integrated into the vehicle streamer?

Sorry bad English.
Reply

Quote:
Originally Posted by d711728
View Post
Incognito will be integrated into the vehicle streamer?

Sorry bad English.
Incognito already told him that he can.

Quote:
Originally Posted by Incognito
View Post
If you ever want to merge your changes in the future, just ask me, and I'll create a separate branch where you can send a pull request.
Reply

Hi,

I'm having problems when hooking OnPlayerSelectDynamicObject, it's not being called since the new version.
Please advise.

EDIT: I see that the whole callback section has been removed...
EDIT2: Back to 2.7.2 until fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)