Help me. again. again.
#1

I made a zcmd command and one public OnPlayerCommandText();.
Commands from OnPlayerCommandText doesn't work but the ZCMD commands works.
I want to make OnPlayerCommandText commands work too.


Index:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/000", cmdtext, true) == 0){
{
SetTimer("---", 100, 0);
}
return 1;
}

Finish:

if (strcmp("/fuck", cmdtext, true) == 0){
SetPlayerScore(playerid, -1);
}
return 1;
}

stock GetName(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

CMD:bonus(playerid, params[]) {
new string[128], rand = 1000 + random(8000);
format(string, sizeof(string), "Felicitari %s. Ai castigat $%d.", GetName(playerid), rand);
SendClientMessage(playerid, 0x4AAB1DFF, string);
GivePlayerMoney(playerid, rand);
return 1;
}



anything wrong? i hidden some with - cuz of privacy
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
Just use zcmd, you can't use both.
Someone used them both.
How?
And how do i transform them?
Reply
#3

You don't use OnPlayerCommandText if you use ZCMD*. Just port over your code from the callback and make it a command:

pawn Код:
CMD:000(playerid, params[])
{
    SetTimer("---", 100, 0);
    return 1;
}
pawn Код:
CMD:fuck(playerid, params[])
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
    return 1;
}
SetPlayerScore(playerid, -1) will not work if you want to deduce 1 point from the player's score.

* Important: Since v0.3 OnPlayerCommandText cannot be used anymore (also ZCMD_NO_CALLBACK option has been removed), but there are two new callbacks instead:


EDIT: ****** was faster, sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)