Jump to content

Recommended Posts

Posted (edited)

Deci, am luat acest gamemode de pe forum: http://forum.bugged.ro/topic/254469-gamemode-asemanator-bugged-edited-by-dragos/

Si de 2 zile ma joc pe el in local, cautand bug-uri. Am modificat cateva lucruri pe care le putea face oricine, ma refer la niste coordonate, insa vreau sa implementez si comanda /gotohq. Cu ceva ajutor am realizat asta https://pastebin.com/Z1ZAsHnE

Si daca dau compile, ce sa vezi, Pawno Library has stopped working, fisierul .amx disparand. Si cum chestiile de genu se intampla in special cand ai facut schimbari majore pe care gm-ul nu le suporta rezulta ca ceea ce am pus in gamemode nu merge. Ceva ajutor?

 

Alte precizari: am 13 factiuni, factiunea cu ID 7 fiind insa invalida, deci am 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12 ,13, 14

Edited by BenisBa
Posted (edited)


CMD:gotohq (playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_ERROR, AdminOnly);
new sendername[MAX_PLAYER_NAME + 1], string[128];
if(sscanf(params, "i", id)) return SCM(playerid, COLOR_GREY, "Syntax: /gotohq [ID]");
if(id < 1 || id > 13 ) return SCM(playerid, -1, "Invalid HQ ID");
if(id == 1) { SetPlayerPos(playerid, 1554.0900,-1675.2311,16.1953); }
SetPlayerInterior(playerid, 0), SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, sendername, MAX_PLAYER_NAME + 1)
format(string, 128, "Admin %s has teleported to HQ %d.", sendername, id), ABroadCast(COLOR_WHITE, STRING, 1);
format(string, 128, "You have been teleported to HQ %d.", id), SCM(playerid, -1, string);
return 1;
}

 

Edited by L0K3D_Hokage
Posted (edited)


CMD:gotohq (playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_ERROR, AdminOnly);
new sendername[MAX_PLAYER_NAME + 1], string[128];
if(sscanf(params, "i", id)) return SCM(playerid, COLOR_GREY, "Syntax: /gotohq [ID]");
if(id < 1 || id > 13 ) return SCM(playerid, -1, "Invalid HQ ID");
if(id == 1) { SetPlayerPos(playerid, 1554.0900,-1675.2311,16.1953); }
SetPlayerInterior(playerid, 0), SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, sendername, MAX_PLAYER_NAME + 1)
format(string, 128, "Admin %s has teleported to HQ %d.", sendername, id), ABroadCast(COLOR_WHITE, STRING, 1);
format(string, 128, "You have been teleported to HQ %d.", id), SCM(playerid, -1, string);
return 1;
}

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30452) : error 017: undefined symbol "id"

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30453) : error 017: undefined symbol "id"

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30454) : error 017: undefined symbol "id"

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30457) : error 001: expected token: ";", but found "-identifier-"

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30457) : error 017: undefined symbol "id"

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30458) : error 017: undefined symbol "id"

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30726) : warning 217: loose indentation

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30727) : warning 217: loose indentation

 

 

Astea sunt warning-urile de la compiler... Nu merge. Ti-am aratat doar warning-urile de la liniile care ne intereseaza, mai erau cateva warnings dar erau de la linii indepartate.

Sigur nu ai pus gresit paranteza aia ratacita de dupa params? E doar o presupunere, tu stii mai bine.

 

Edited by BenisBa
Posted

CMD:gotohq (playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_ERROR, AdminOnly);
new id, sendername[MAX_PLAYER_NAME + 1], string[128];
if(sscanf(params, "i", id)) return SCM(playerid, COLOR_GREY, "Syntax: /gotohq [ID]");
if(id < 1 || id > 13 ) return SCM(playerid, -1, "Invalid HQ ID");
if(id == 1) { SetPlayerPos(playerid, 1554.0900,-1675.2311,16.1953); }
SetPlayerInterior(playerid, 0), SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, sendername, MAX_PLAYER_NAME + 1);
format(string, 128, "Admin %s has teleported to HQ %d.", sendername, id), ABroadCast(COLOR_WHITE, STRING, 1);
format(string, 128, "You have been teleported to HQ %d.", id), SCM(playerid, -1, string);
return 1;
}
Posted (edited)
CMD:gotohq (playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, COLOR_ERROR, AdminOnly);
    new id, sendername[MAX_PLAYER_NAME + 1], string[128];
    if(sscanf(params, "i", id)) return SCM(playerid, COLOR_GREY, "Syntax: /gotohq [ID]");
    if(id < 1 || id > 13 ) return SCM(playerid, -1, "Invalid HQ ID");
    if(id == 1) { SetPlayerPos(playerid, 1554.0900,-1675.2311,16.1953); }
    SetPlayerInterior(playerid, 0), SetPlayerVirtualWorld(playerid, 0);
    GetPlayerName(playerid, sendername, MAX_PLAYER_NAME + 1);
    format(string, 128, "Admin %s has teleported to HQ %d.", sendername, id), ABroadCast(COLOR_WHITE, STRING, 1);
    format(string, 128, "You have been teleported to HQ %d.", id), SCM(playerid, -1, string);
    return 1;
}

Bun, am mai scapat de erorile din compiler, dar a disparut dragosGM.amx. Iar cand rulez samp-server.exe...

[15:03:54] I couldn't load any gamemode scripts. Please verify your server.cfg
[15:03:54] It needs a gamemode0 line at the very least.
 
EDIT: conteaza unde plasez script-ul in gamemode?
Edited by BenisBa
Posted (edited)

Cand compilezi un fisier de tip .pwn compilerul verifica codul si il converteaza in alt format, in .amx doar daca nu ai erori. Pentru a rula serverul ai nevoie de fisierul .amx nu .pwn.

Iti propun sa incepi sa inveti baza de pe SA:MP Wiki.

Edited by L0K3D_Hokage
Posted

Cand compilezi un fisier de tip .pwn compilerul verifica codul si il converteaza in alt format, in .amx doar daca nu ai erori. Pentru a rula serverul ai nevoie de fisierul .amx nu .pwn.

Iti propun sa incepi sa inveti baza de pe SA:MP Wiki.

Partea cu 'ai nevoie de fisierul amx ca sa rulezi serverul' intr-adevar o stiam... dar totusi cum scap de acea eroare pomenita de tine, care apropo, este asta:

C:\Users\V\Desktop\Gamemode by Dragos (1)\gamemodes\dragosGM.pwn(30792) : error 017: undefined symbol "STRING"

 

O sa ma interesez si pe alte site-uri, gen SAMP Wiki, tutoriale, si pe unde mai gasesc.

Posted

E vorba si de cunostinte generale, undefined symbol "STRING" - tradu pe bing.com/translator si incearca sa rezolvi singur.

Posted

Du-te la acea linie si cauta unde scrie "STRING". Inlocuieste cu "string", greseala e la comanda /gotohq.

Asta era. Multumesc.

 

E vorba si de cunostinte generale, undefined symbol "STRING" - tradu pe bing.com/translator si incearca sa rezolvi singur.

Multumesc de ajutor.

Posted

Poftim commanda:

CMD:gotohq(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
   {
    new hqid, string[128], name[30];
    if(sscanf(params, "d", hqid)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /gotohq [faction id]");
    if(hqid < 0 || hqid > 18) return SendClientMessage(playerid, COLOR_GREY, "Invalid hq id.");
    SetPlayerPosEx(playerid, DynamicFactions[hqid][fceX], DynamicFactions[hqid][fceY], DynamicFactions[hqid][fceZ]);
    SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s used /gotohq %d.", name, hqid);
ABroadCast(COLOR_ADMCOMMANDS, string, 1);
   }
   else return SCM(playerid, COLOR_LIGHTGREEN3, AdminOnly);
}
return 1;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.

moduri samp