Jump to content
  • 0

/minigun !?


Question

Posted

Salut !

Am luat o comanda /minigun din GM-ul unui server:

[pawn] if(!strcmp(cmdtext, "/minigun", true))

{

ResetPlayerWeapons(playerid);

DM[playerid] = 1;

InMinigun[playerid] = 1;

SetPlayerRandomSpawnMinigun(playerid);

GivePlayerWeapon(playerid,38 , 9999);

GameTextForPlayer(playerid,"~r~~h~Welcome to Minigun",3000,5);

    GetPlayerName(playerid, pname, sizeof (pname));

    format(string3, sizeof(string3),"%s Has Gone to Minigun ~r~(/minigun)~p~", pname);

    TextDrawDestroy(Text:Reclama);

    Reclama = TextDrawCreate(250.000000, 435.000000, " ");

    TextDrawFont(Reclama, 1);

    TextDrawLetterSize(Reclama, 0.300000, 1.000000);

    TextDrawColor(Reclama, 0x00C2ECFF);

    TextDrawSetOutline(Reclama, 1);

    TextDrawSetProportional(Reclama, 1);

    TextDrawSetShadow(Reclama, 1);

    TextDrawShowForAll(Reclama);

    TextDrawSetString(Reclama, string3);

    SetTimer("reclamatime",10000,false);

SetPlayerFacingAngle(playerid, 0.0);

SetPlayerInterior(playerid, 0);

SetPlayerWorldBounds(playerid, 1439.348, 1271.44, 2235.263, 2080.541);

SendClientMessage(playerid, 0x6AF7E1FF, " If you are caught fire zone STUNT These weapons MAKE JAIL / kick / ban permanently!");

SendClientMessage(playerid,COLOR_GREEN, "If you want to get out of DM use the command /kill!");

    return 1;

}[/pawn]

Si am luat si comanda cu care sa poti iesi din acea zona:

[pawn]    if (strcmp("/exitm", cmdtext, true, 10) == 0)

    {

    if(InMinigun[playerid] == 1)

    {

    if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);

SetPlayerPos(playerid,403.447265,2466.154296,16.506214);

ResetPlayerWeapons(playerid);

SetPlayerWorldBounds(playerid, 20000.0000,-20000.0000,20000.0000,-20000.0000); // Bounderies Off//

    DM[playerid] = 0;

InMinigun[playerid] = 0;

}

if(InMinigun[playerid] == 0)

    {

    SendClientMessage(playerid,COLOR_ULTRARED,"You are not in Minigun zone. Type /minigun");

    }

return 1;

    }[/pawn]

Am pus sus in script:

[pawn]new InMinigun[MAX_PLAYERS];[/pawn]

Apoi, am pus si unde am eu new Float:

[pawn]new Float:gRandomPlayerSpawnsMinigun[10][0] = {

{1410.5425,2176.3142,12.0156},

{1409.6898,2206.1653,19.8438},

{1370.7050,2196.3381,9.7578},

{1321.1451,2196.9858,11.0234},

{1329.6407,2210.1064,12.0156},

{1298.7916,2156.4512,11.0234},

{1325.2078,2101.3110,11.0156},

{1416.5570,2102.6685,23.4782},

{1390.2469,2218.6946,23.4464},

{1418.9036,2125.6411,29.6907}

};[/pawn]

Am pus si unde am forwards:

[pawn]forward SetPlayerRandomSpawnMinigun(playerid);[/pawn]

Apoi, dedesubt la public OnGameModeExit() am pus asa:

[pawn]public SetPlayerRandomSpawnMinigun(playerid)

{

    if (iSpawnSet[playerid] == 0)

    {

new rand = random(sizeof(gRandomPlayerSpawnsMinigun));

SetPlayerPos(playerid, gRandomPlayerSpawnsMinigun[rand][0], gRandomPlayerSpawnsMinigun[rand][1], gRandomPlayerSpawnsMinigun[rand][2]); // Warp the player

}

return 1;

}[/pawn]

Am dat compile si imi da asa:

D:\[RSG]\gamemodes\RSG4564212RO.pwn(2539) : error 017: undefined symbol "iSpawnSet"

D:\[RSG]\gamemodes\RSG4564212RO.pwn(2539) : warning 215: expression has no effect

D:\[RSG]\gamemodes\RSG4564212RO.pwn(2539) : error 001: expected token: ";", but found "]"

D:\[RSG]\gamemodes\RSG4564212RO.pwn(2539) : error 029: invalid expression, assumed zero

D:\[RSG]\gamemodes\RSG4564212RO.pwn(2539) : fatal error 107: too many error messages on one line

Am pus sus in script asa:

[pawn]new iSpawnSet[MAX_PLAYERS];[/pawn]

Am dat compile, totul bine. Dar cand intru pe server si dau /minigun, ma teleporteaza acolo, imi da minigun, dar daca dau de exemplu: /sf, ma teleporteaza acolo (asta se intampla pe serverul meu). Si dupa ce ma teleportez la /minigun, daca dau de exemplu /goto, ar trebui sa-mi trimita un SendClientMessage, dar nu mi-l trimite:

[pawn] SendClientMessage(playerid,COLOR_RED, "Type /exitm for leave.");[/pawn]

Asta se intampla pe serverul meu, dupa ce am pus tot ce apartine de minigun de pe celalalt server.

Pe celalat server ( serverul de pe care am luat /minigun si tot ce tine de comanda ) cand ma duc la /minigun, daca dau de exemplu /goto, imi trimite SendClientMessage-ul:

[pawn] SendClientMessage(playerid,COLOR_RED, "Type /exitm for leave.");[/pawn]

dar pe serverul meu nu mi-l trimite. Am cautat in GM-ul serverului de pe care am luat /minigun, si am gasit SendClientMessage-ul care trebuia sa apara cand incercam o comanda:

[pawn]    }

    else

format(string, sizeof(string),"Type /exitm for leave the DeathMatch.",cmdtext);

    SendClientMessage(playerid, 0xE60000FF, string);

    return 1;

}[/pawn]

Am incercat sa pun:

[pawn]    }

    else

format(string, sizeof(string),"Type /exitm for leave the DeathMatch.",cmdtext);

    SendClientMessage(playerid, 0xE60000FF, string);

    return 1;

}[/pawn]

la sfarsitul comenzii /minigun, dar nu e bine asa, pentru ca imi da "Pawno Stopped Working".

Unde trebuie sa adaug SendClientMessage-ul de mai sus ? M-am uitat si in tutorialul lui stuntman, dar am facut tot ce trebuia. Am copiat tot ce continea "minigun" din GM-ul serverului acela, in GM-ul serverului meu, dar merge sa ma teleportez.

Nu reusesc deloc sa rezolv. De cateva zile incerc, dar nu reusesc.

www.youtube.com/thebwgg

10 answers to this question

Recommended Posts

Posted

Sterge toate variabilele alea, si inlocuieste InMinigun[playerid] = 1; cu InDM[ playerid ] = 1; sau cum folosesti tu in GM tau.

Schimba

public SetPlayerRandomSpawnMinigun(playerid)
{
    if (iSpawnSet[playerid] == 0)
    {
		new rand = random(sizeof(gRandomPlayerSpawnsMinigun));
		SetPlayerPos(playerid, gRandomPlayerSpawnsMinigun[rand][0], gRandomPlayerSpawnsMinigun[rand][1], gRandomPlayerSpawnsMinigun[rand][2]); // Warp the player
	}
	return 1;
}
cu
public SetPlayerRandomSpawnMinigun(playerid)
{
	new rand = random(sizeof(gRandomPlayerSpawnsMinigun));
	SetPlayerPos(playerid, gRandomPlayerSpawnsMinigun[rand][0], gRandomPlayerSpawnsMinigun[rand][1], gRandomPlayerSpawnsMinigun[rand][2]); // Warp the player
	return 1;
}

PS: Tu nu gandesti deloc cand "scriptezi" totul este LOGIC. ( si am facut abia o ora de logica la scoala :)) )

Posted

Multumesc @![]stuntman[]!. Dar mai am 2 probleme:

-comanda /goto merge cand sunt la minigun ( cum fac sa nu mearga nici /goto ?)

-cand apas o comanda, de exemplu /sf, imi apare un dialog "Nu poti iesi din acea zona." si eu am pus in GM la acel dialog "Type /exitm for exit." si nu stiu de ce apare alt dialog.

P.S: Mai am alte dialog-uri cu "Nu poti iesi din acea zona." poate fi de la asta ?

www.youtube.com/thebwgg

Posted

Deci, sa-ti spun adevarul despre tine?

Tot serverul tau ii made by: www.sa-mp.ro !!! la fiecare problema penibila pe care ai avut-o orice error ai venit pe sa-mp.ro sa ceri sprijin cu accea problema...NU STII SA GANDESTI!!! aici ( in scripting ) totul tine de gandit un pic...

1.Comanda /goto iti merge de aia ca LAdmin-ul sau LuxAdmin-ul il ai in FS nu in GameMode...si de aceea nu cred ai cum sa blochezi folosirea comenzii aceleia sau a oricareia din Admin script...

2.Poate se incurca ID-urile dialogului...

Fara reclama in semnatura!

Posted

Le-am rezolvat.

1. Am pus ResetPlayerWeapons [playerid]; la comanda dcmd_goto.

2.Acum apare bine.

Si serverul meu nu e "made by sa-mp.ro" ;)NU postez fara sa incerc sa rezolv ceva !

Dati locked.

www.youtube.com/thebwgg

Posted

SCUZE PENTRU REPLY !

Cand mor la /minigun, ma spawneaza in alta parte. Cum as putea sa fac ma spawneze tot la /minigun ?

Fa-l dupa tutorialul meu de Respawn in DM si nu vei avea nici o probleme. Este la sectiunea tutoriale, cauta-l, fa macar asta daca altceva nu stii.
Posted

LOL !? Nu am SetPlayerPos in comanda /minigun. :undecided:

[pawn] if(!strcmp(cmdtext, "/minigun", true))

{

if(DM[playerid] == 1) return  GameTextForPlayer(playerid,"~r~~h~Use /exitm for leave.",3000,5);

ResetPlayerWeapons(playerid);

DM[ playerid ] = 1;

    SpawnInDM[ playerid ] = "/minigun";

GameTextForPlayer(playerid,"~r~~h~Type /exitm for leave!",3000,5);

    GetPlayerName(playerid, pname, sizeof (pname));

    format(string3, sizeof(string3),"%s Has Gone to Minigun ~r~(/minigun)~p~", pname);

    TextDrawDestroy(Text:Reclama);

    Reclama = TextDrawCreate(250.000000, 435.000000, " ");

    TextDrawFont(Reclama, 1);

    TextDrawLetterSize(Reclama, 0.300000, 1.000000);

    TextDrawColor(Reclama, 0x00C2ECFF);

    TextDrawSetOutline(Reclama, 1);

    TextDrawSetProportional(Reclama, 1);

    TextDrawSetShadow(Reclama, 1);

    TextDrawShowForAll(Reclama);

    TextDrawSetString(Reclama, string3);

    SetTimer("reclamatime",10000,false);

SetPlayerRandomSpawnMinigun(playerid);

GivePlayerWeapon(playerid,38 , 9999);

    GetPlayerName(playerid, pname, sizeof (pname));

SetPlayerFacingAngle(playerid, 0.0);

SetPlayerInterior(playerid, 0);

SetPlayerWorldBounds(playerid, 1439.348, 1271.44, 2235.263, 2080.541);

    return 1;

}[/pawn]

www.youtube.com/thebwgg

Posted

Ok,nu ai setplayerpos la comanda /minigun.Banuiesc ca o vrei in scriptul dat....Poftim!

	if(!strcmp(cmdtext, "/minigun", true))
	{
	if(DM[playerid] == 1) return  GameTextForPlayer(playerid,"~r~~h~Use /exitm for leave.",3000,5);
	ResetPlayerWeapons(playerid);
	DM[ playerid ] = 1;
    SpawnInDM[ playerid ] = "/minigun";
	GameTextForPlayer(playerid,"~r~~h~Type /exitm for leave!",3000,5);
    GetPlayerName(playerid, pname, sizeof (pname));
    format(string3, sizeof(string3),"%s Has Gone to Minigun ~r~(/minigun)~p~", pname);
    TextDrawDestroy(Text:Reclama);
    Reclama = TextDrawCreate(250.000000, 435.000000, " ");
    TextDrawFont(Reclama, 1);
    TextDrawLetterSize(Reclama, 0.300000, 1.000000);
    TextDrawColor(Reclama, 0x00C2ECFF);
    TextDrawSetOutline(Reclama, 1);
    TextDrawSetProportional(Reclama, 1);
    TextDrawSetShadow(Reclama, 1);
    TextDrawShowForAll(Reclama);
    TextDrawSetString(Reclama, string3);
    SetTimer("reclamatime",10000,false);
	SetPlayerRandomSpawnMinigun(playerid);
	GivePlayerWeapon(playerid,38 , 9999);
    GetPlayerName(playerid, pname, sizeof (pname));
	SetPlayerFacingAngle(playerid, 0.0);
	SetPlayerInterior(playerid, 0);
[color=red]SetPlayerPos(playerid, X.x,Y.y,Z.z)[/color]   
	SetPlayerWorldBounds(playerid, 1439.348, 1271.44, 2235.263, 2080.541);
    return 1;
	}

Posted

LOL !? Nu am SetPlayerPos in comanda /minigun. :undecided:

[pawn] if(!strcmp(cmdtext, "/minigun", true))

{

if(DM[playerid] == 1) return  GameTextForPlayer(playerid,"~r~~h~Use /exitm for leave.",3000,5);

ResetPlayerWeapons(playerid);

DM[ playerid ] = 1;

    SpawnInDM[ playerid ] = "/minigun";

GameTextForPlayer(playerid,"~r~~h~Type /exitm for leave!",3000,5);

    GetPlayerName(playerid, pname, sizeof (pname));

    format(string3, sizeof(string3),"%s Has Gone to Minigun ~r~(/minigun)~p~", pname);

    TextDrawDestroy(Text:Reclama);

    Reclama = TextDrawCreate(250.000000, 435.000000, " ");

    TextDrawFont(Reclama, 1);

    TextDrawLetterSize(Reclama, 0.300000, 1.000000);

    TextDrawColor(Reclama, 0x00C2ECFF);

    TextDrawSetOutline(Reclama, 1);

    TextDrawSetProportional(Reclama, 1);

    TextDrawSetShadow(Reclama, 1);

    TextDrawShowForAll(Reclama);

    TextDrawSetString(Reclama, string3);

    SetTimer("reclamatime",10000,false);

SetPlayerRandomSpawnMinigun(playerid);

GivePlayerWeapon(playerid,38 , 9999);

    GetPlayerName(playerid, pname, sizeof (pname));

SetPlayerFacingAngle(playerid, 0.0);

SetPlayerInterior(playerid, 0);

SetPlayerWorldBounds(playerid, 1439.348, 1271.44, 2235.263, 2080.541);

    return 1;

}[/pawn]

Copil copac, SetPlayerRandomSpawnMinigun.
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.