Sziasztok találtam itt a fórumon egy DM -et mi MTA Derby -hez hasonlít
És átt alakítottam picit
De nem indúl el Pawno-ban hibátlan pedig.
#include <a_samp>
#include <streamer>
#include <zcmd>
#include <fixchars>
#define VEHICLE 504
#define DIALOG_CONNECT 3456
new
bool:minigame[7],
Timer[MAX_PLAYERS],
helycount = 0;
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,0xfff700AA,\"Minigame Test\");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_CONNECT)
{
if(response)
{
if(listitem == 0)
{
if(helycount == 6) return SendClientMessage(playerid,-1,\"WARNING:Nincs több hely\");
helycount++;
minigame[helycount] = true;
Csatlakozas(playerid,helycount);
SetPVarInt(playerid,\"M\",1);
}
}
return 1;
}
return 0;
}
//PARANCSOK=======================================================================
CMD:exitmini(playerid)
{
if(GetPVarInt(playerid,\"M\") == 0) return SendClientMessage(playerid,-1,\"WARNING: Nem tartozkodsz minigaméban\");
helycount--;
minigame[helycount] = false;
SetPVarInt(playerid,\"M\",0);
SetPlayerPos(playerid,1958.3783,1343.1572,15.3746);
if(IsPlayerInAnyVehicle(playerid)) DestroyVehicle(GetPlayerVehicleID(playerid));
return 1;
}
CMD:minigame(playerid)
{
if(GetPVarInt(playerid,\"M\") == 1) return SendClientMessage(playerid,-1,\"Te már a Minigame-ban vagy\");
ShowPlayerDialog(playerid, DIALOG_CONNECT, DIALOG_STYLE_LIST, \"Minigame Panel\", \"MTA Derby\", \"Select\", \"Close\");
return 1;
}
forward Csatlakozas(playerid,helyid);
public Csatlakozas(playerid,helyid)
{
new vehicle;
switch(helyid)
{
case 1: SetPlayerPos(playerid,2962.7034,-2054.4771,4.5000), vehicle = CreateVehicle(VEHICLE,2962.7034,-2054.4771,4.5000,269.5526,1,1,-1);
case 2: SetPlayerPos(playerid,3012.4294,-2108.4832,4.4000), vehicle = CreateVehicle(VEHICLE,3012.4294,-2108.4832,4.4000,4.3030,1,1,-1);
case 3: SetPlayerPos(playerid,3012.7112,-1961.9540,4.4000), vehicle = CreateVehicle(VEHICLE,3012.7112,-1961.9540,4.4000,181.8159,1,1,-1);
case 4: SetPlayerPos(playerid,3059.6064,-1949.9526,4.4000), vehicle = CreateVehicle(VEHICLE,3059.6064,-1949.9526,4.4000,182.6933,1,1,-1);
case 5: SetPlayerPos(playerid,3108.1431,-2022.1266,4.4000), vehicle = CreateVehicle(VEHICLE,3108.1431,-2022.1266,4.4000,94.3741,1,1,-1);
case 6: SetPlayerPos(playerid,3058.0200,-2126.6311,4.4000), vehicle = CreateVehicle(VEHICLE,3058.0200,-2126.6311,4.4000,0.2062,1,1,-1);
}
PutPlayerInVehicle(playerid,vehicle,0);
Timer[playerid] = SetTimerEx(\"Kiesett\",2000,true,\"i\",playerid);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetPVarInt(playerid,\"M\") == 1)
{
DestroyVehicle(GetPlayerVehicleID(playerid));
GameTextForPlayer(playerid,\"~r~Kiszáltál a Jármûbõl ezért kiestél\",2500,6);
SetPVarInt(playerid,\"M\",0);
helycount--;
minigame[helycount] = false;
SetPlayerPos(playerid,1958.3783,1343.1572,15.3746);
}
return 1;
}
forward Kiesett(playerid);
public Kiesett(playerid)
{
new Float:P[3];
GetPlayerPos(playerid,P[0],P[1],P[2]);
if(P[2] < 0) {
GameTextForPlayer(playerid,\"~r~Kiestél\",2500,6);
helycount--;
minigame[helycount] = false;
KillTimer(Timer[playerid]);
SetPVarInt(playerid,\"M\",0);
DestroyVehicle(GetPlayerVehicleID(playerid));
SetPlayerPos(playerid,1958.3783,1343.1572,15.3746);
}
return 1;
}
//stock=========================>>>>>>>>>>>>>>>>>
stock JoinDM()
{
new count = 0;
for(new i = 0; i < 6; i++)
{
if(minigame == false) continue;
if(minigame == true) count++;
}
return count;
}