Jump to content
  • 0

Ajutor m33=)


[RMD]Alien

Question

Decii am server si nu am comanda aceasta explode ft important din server si am adaugato linga toate celelate comeznii de admin am adaugat asta

dcmd_explode(playerid, params[]) {
	if (PlayerInfo[playerid][AdminLevel] >= 3) {
		new id;
	    if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /explode <playerid>");
	    if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
	    new PlayerName[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
		new ReturnName[MAX_PLAYER_NAME];
		GetPlayerName(id, ReturnName, sizeof(ReturnName));
	    new Float:x, Float:y, Float:z;
	    GetPlayerPos(id, x,y, z);
	    CreateExplosion(x, y, z, 4, 10.00);
	    format(szString, sizeof(szString), "* You exploded %s (ID:%d)", ReturnName, id);
	    SendClientMessage(playerid, COLOR_GREEN, szString);
	    format(szString, sizeof(szString), "Admin %s, Used The Command 'EXPLODED' Target: %s(%d)", PlayerName, ReturnName, id);
	    SendClientMessageToAdmins(szString);
	}
	else {
		return 0;
	}
    return 1;
}

Dupa Am intrat pe server si imi zice ca comanda aceasta nu exista dc?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Adauga la OnPlayerCommandText

Pawno Code: [select]

dcmd(explode,7,cmdtext);

si asta

Pawno Code: [select]

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

undeva sus in headerul scriptului, inafara unei functii ..

defapt, direct dupa includes si gata

de fiecare data cand adaugi o comanda in dcmd trebuie sa adaugi si la OnPlayerCommandText

Pawno Code: [select]

dcmd(comanda,cate caractere are comanda,cmdtext);

Link to comment
Share on other sites

Incearca sa pui comanda asta drept /explode:

[pawn]if(strcmp(cmd, "/explode", true) == 0)

{

    GetPlayerName(playerid, sendername, sizeof(sendername));

tmp = strtok(cmdtext, idx);

if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 1338)

{

SendClientMessage(playerid, COLOR_GREY, "/explode [Playerid]");

return 1;

}

giveplayerid = strval(tmp);

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

if(IsPlayerConnected(giveplayerid))

{

if(PlayerInfo[playerid][pAdmin] >= 1338)

{

    if(IsPlayerConnected(giveplayerid))

    {

format(string, sizeof(string), "Admin: %s was exploded by %s",giveplayer, sendername);

ABroadCast(COLOR_LIGHTRED,string,1);

//SendClientMessageToAll(COLOR_DBLUE, string);

SetPlayerHealth(giveplayerid, 10);

new Float:boomx, Float:boomy, Float:boomz;

GetPlayerPos(giveplayerid,boomx, boomy, boomz);

CreateExplosion(boomx, boomy , boomz, 7, 10);

new PlayerName2[30];

GetPlayerName(playerid, PlayerName2, 30);

printf("[Command] %s has used /explode to explode %s", PlayerName2, giveplayer);

}

else

{

    format(string, sizeof(string), "%d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_RED, string);

}

}

else

{

SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!");

}

}

else

{

    SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!");

}

return 1;

}[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.