Jump to content

Question

Posted

Salut! Vreau sa-mi fac si eu comanda care sa ma teleporteze la checkpoint (nu la marker d-ala de pe mapa). As dori sa fie pentru admin 1 in sus si sa fie /gotocp. Multumesc anticipat!

14 answers to this question

Recommended Posts

  • 0
Posted (edited)

Care este linia 13949? Și vezi că am dat edit la postare ... am nevoie de linia 13949

 

 

EDIT: Mda...nu am observat ceva , poftim: 

CMD:gotocp(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 1) return 1;
    if(InGame[playerid] == 1) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece esti in arena! Foloseste comanda /leavearena pentru a iesi.");
    SetPlayerPosEx(playerid,CheckpointPos[playerid][0], CheckpointPos[playerid][1], CheckpointPos[playerid][2]);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    new string[180];
    format(string, sizeof(string), "AdmCmd: %s s-a teleportat la checkpoint.",PlayerNameEx(playerid));
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 1);
    return 1;
}

Scuze , pentru mine este abea dimineață , acuma m-am trezit. :))

Edited by Ph0eniX
  • Upvote 1
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

  • 0
Posted

 

La inceputul gamemodeului  new AdminCP[MAX_PLAYERS][3];

CTRL+H SetPlayerCheckpoint si jos SetPlayerCheckpointEx  pentru a inlocui toate funtiile de setare a checkpointurilor

la finalul gmului

stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size)
{
    AdminCP[playerid][0] = x;
    AdminCP[playerid][1] = y;
    AdminCP[playerid][2] = z;
    return SetPlayerCheckpoint(playerid, x, y, z, size);
}

 

iar pentru comanda sper ca stii cmd: gotocp   si setplayerpoz  AdminCP[playerid][0] , blabla[1], blabla[2]

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted (edited)

 

Acum 11 ore, Mister a spus:

 

La inceputul gamemodeului  new AdminCP[MAX_PLAYERS][3];

CTRL+H SetPlayerCheckpoint si jos SetPlayerCheckpointEx  pentru a inlocui toate funtiile de setare a checkpointurilor

la finalul gmului


stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size)
{
    AdminCP[playerid][0] = x;
    AdminCP[playerid][1] = y;
    AdminCP[playerid][2] = z;
    return SetPlayerCheckpoint(playerid, x, y, z, size);
}

 

iar pentru comanda sper ca stii cmd: gotocp   si setplayerpoz  AdminCP[playerid][0] , blabla[1], blabla[2]

Am o mica intrebare: Eu am gm-ul Burned si toate functiile SetPlayerCheckpoint sunt deja inlocuite cu SetPlayerCheckpointEx , iar daca fac cum ai zis tu vor deveni SetPlayerCheckpointExEx , este in regula?

Edited by Davidoff7776
  • 0
Posted

Cauta la finalul gamemodeului stock setplayercheckpointex sau public setplayer.... ori simplu trebuie sa fie o functie daca nu stii cum arata o functie nu prea mai are rost sa incerci. In primul meu  comentariu este un stock  cu parametri asa ar trebui sa arate si la tine

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted
Acum 14 ore, Mister a spus:

 

La inceputul gamemodeului  new AdminCP[MAX_PLAYERS][3];

CTRL+H SetPlayerCheckpoint si jos SetPlayerCheckpointEx  pentru a inlocui toate funtiile de setare a checkpointurilor

la finalul gmului


stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size)
{
    AdminCP[playerid][0] = x;
    AdminCP[playerid][1] = y;
    AdminCP[playerid][2] = z;
    return SetPlayerCheckpoint(playerid, x, y, z, size);
}

 

iar pentru comanda sper ca stii cmd: gotocp   si setplayerpoz  AdminCP[playerid][0] , blabla[1], blabla[2]

exact cum a zis el doar ca nu este necesara utilizarea de "stock" . A fost des discutata si pe alte forumuri si nu este bine sa folosesti stock decat cand este cazul.

astfel,poti utiliza pur si simplu fara stock,altfel:

SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, FLoat:size)
	{
	...
	...
	

  • 0
Posted
Acum 10 minute, Mister a spus:

Cauta la finalul gamemodeului stock setplayercheckpointex sau public setplayer.... ori simplu trebuie sa fie o functie daca nu stii cum arata o functie nu prea mai are rost sa incerci. In primul meu  comentariu este un stock  cu parametri asa ar trebui sa arate si la tine

poftim

function SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size) {
    SetPlayerCheckpoint(playerid, x, y, z, size);
    CheckpointPos[playerid][0] = x;
    CheckpointPos[playerid][1] = y;
    CheckpointPos[playerid][2] = z;
    return 1;
}

  • 0
Posted

Nu mai ai nevoie de nimic din ce am postat pentru ca este deja facut, doar faci comanda cmd: gotocp playerid params  

setplayerpos 

CheckpointPos[playerid][0]
CheckpointPos[playerid][1]
CheckpointPos[playerid][2]

Restrictie de admin un sendclientmessage si gata

  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
  • 0
Posted (edited)
Acum 54 minute, Mister a spus:

Nu mai ai nevoie de nimic din ce am postat pentru ca este deja facut, doar faci comanda cmd: gotocp playerid params  

setplayerpos 


CheckpointPos[playerid][0]

CheckpointPos[playerid][1]

CheckpointPos[playerid][2]

Restrictie de admin un sendclientmessage si gata

am primit erorile astea:

	C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13949) : warning 213: tag mismatch
C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13949) : error 001: expected token: ",", but found ";"
C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13953) : error 001: expected token: ",", but found ";"
C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13946) : warning 203: symbol is never used: "id"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
	
2 Errors.

CMD:gotocp(playerid, params[]) {
    new id;
    if(PlayerInfo[playerid][pAdmin] < 1) return 1;
    if(InGame[playerid] == 1) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece esti in arena! Foloseste comanda /leavearena pentru a iesi.");
    SetPlayerPosEx(CheckpointPos[playerid][0], CheckpointPos[playerid][1], CheckpointPos[playerid][2];
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    new string[180];
    format(string, sizeof(string), "AdmCmd: %s s-a teleportat la checkpoint.";
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 1);
    return 1;
}
Edited by Davidoff7776
  • 0
Posted (edited)
CMD:gotocp(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 1) return 1;
    if(InGame[playerid] == 1) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece esti in arena! Foloseste comanda /leavearena pentru a iesi.");
    SetPlayerPosEx(CheckpointPos[playerid][0], CheckpointPos[playerid][1], CheckpointPos[playerid][2]);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    new string[180];
    format(string, sizeof(string), "AdmCmd: %s s-a teleportat la checkpoint.",PlayerNameEx(playerid));
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 1);
    return 1;
}

În loc de PlayerNameEx(playerid) pui funcția pe care o ai tu ... 

Edited by Ph0eniX
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

  • 0
Posted
Acum 4 minute, Ph0eniX a spus:

CMD:gotocp(playerid, params[]) {
    new id;
    if(PlayerInfo[playerid][pAdmin] < 1) return 1;
    if(InGame[playerid] == 1) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece esti in arena! Foloseste comanda /leavearena pentru a iesi.");
    SetPlayerPosEx(CheckpointPos[playerid][0], CheckpointPos[playerid][1], CheckpointPos[playerid][2]);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    new string[180];
    format(string, sizeof(string), "AdmCmd: %s s-a teleportat la checkpoint.");
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 1);
    return 1;
}

....

Merci :* , dar pot sa scap de astea?

	C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13949) : warning 213: tag mismatch
C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13949) : warning 202: number of arguments does not match definition
C:\Users\DAVID\Desktop\burned.ro\gamemodes\wa-rpg.pwn(13946) : warning 203: symbol is never used: "id"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase
	
3 Warnings.

  • 0
Posted
Acum 1 minut, Ph0eniX a spus:

Care este linia 13949? Și vezi că am dat edit la postare ... am nevoie de linia 13949

SetPlayerPosEx(CheckpointPos[playerid][0], CheckpointPos[playerid][1], CheckpointPos[playerid][2]);

  • 0
Posted

Ai mai sus , am dat edit la post.

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.