SA-MP Forums Archive
streamer cp - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: streamer cp (/showthread.php?tid=216756)



streamer cp - THE_KNOWN - 26.01.2011

whats wrong with this? compiles without errors:

Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
	if(checkpointid == cp[0])
	    {
	        if(Member[playerid] != 4)
	            {
	                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Organisation:SAPD", "WIP","Ok","");
	            }
	    }
	if(checkpointid == cp[1])
	    {
	        if(Member[playerid] != 2)
	            {
	                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Organisation:SWAT", "WIP","Ok","");
	            }
	    }
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1)
	    {
	        if(response)
	            {
	            SendClientMessage(playerid, red, "BLAH");
	            }
			return 0;
		}
	if(dialogid == 1)
	    {
	        if(response)
	            {
	            SendClientMessage(playerid, red, "BLAH");
	            }
	        return 0;
		}
	return 0;
}
i can see the cp


Re: streamer cp - iggy1 - 26.01.2011

Do you mean you can't see the cp? Show where you create the cp. Also return 1 in OnPlayerDialogResponse or nothing will happen when you use the dialogs.


Re: streamer cp - Not available - 26.01.2011

I think you set the member if() wrong, shouldn't it be like this:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == cp[0])
        {
            if(Member[playerid] == 4)
                {
                    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Organisation:SAPD", "WIP","Ok","");
                }
        }
    if(checkpointid == cp[1])
        {
            if(Member[playerid] == 2)
                {
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Organisation:SWAT", "WIP","Ok","");
                }
        }
    return 1;
}



Re: streamer cp - THE_KNOWN - 26.01.2011

i can but when i step on it it doesnt do anything.(doesnt show dialogs in my case)


Re: streamer cp - iggy1 - 26.01.2011

That prolly because your ids are mixed up show where you create it.


Re: streamer cp - THE_KNOWN - 26.01.2011

the member thing is ok as i have tried it without streamer (i wanted it for non members olny)


Re: streamer cp - THE_KNOWN - 26.01.2011

Код:
cp[0]=CreateDynamicCP(2293.2817,2431.3162,10.8203, 1, -1, -1, -1);//under onplayerspawn
    cp[1]=CreateDynamicCP(2487.6343,2349.3386,10.8203,-1,-1,-1,-1);



Re: streamer cp - Not available - 26.01.2011

Okei, then show us where you create the checkpoints.
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == cp[0] && Member[playerid] != 4)ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Organisation:SAPD", "WIP","Ok","");
    else if(checkpointid == cp[1] && Member[playerid] != 2) ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Organisation:SWAT", "WIP","Ok","");
    return 1;
}



Re: streamer cp - iggy1 - 26.01.2011

Don't put it in onplayerspawn my advice earlier was flawed put it in OnGamemodeInit. (it will still show for all players) otherwise the checkpointid will change everytime a player spawns.


Re: streamer cp - THE_KNOWN - 26.01.2011

gamemodeinit didnt bring me anyluck