how can i put 2 dcmd commands in 1 GM?
#1

Hello, i have made 2 dcmd commands /xkill and /money, they both work but they can't be put together at the same time,error occurs how to put them both in 1 GM? is it about return 0; or return 1;?
Reply
#2

under onplayercommandtext*

dcmd(command,number of letters of the command,cmdtext);
dcmd(othercommand,number of letters of the command , cmdtext);
return 0;
}
--

you can put all the dcmds you want
Reply
#3

that almost helped me but

Code:
C:\Documents and Settings\Administrator\Desktop\SOT\GTA SA Stuff\sampserv\gamemodes\PKDM.pwn(73) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Administrator\Desktop\SOT\GTA SA Stuff\sampserv\gamemodes\PKDM.pwn(73) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\SOT\GTA SA Stuff\sampserv\gamemodes\PKDM.pwn(73) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\Desktop\SOT\GTA SA Stuff\sampserv\gamemodes\PKDM.pwn(73) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator\Desktop\SOT\GTA SA Stuff\sampserv\gamemodes\PKDM.pwn(73) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
this error happens (^), BTW, here is the script
Code:
public OnGameModeInit()
{
dcmd(xkill, 5, cmdtext);
dcmd(money, 5, cmdtext);
return 0;
}
dcmd_xkill(playerid, params[])
{
new	id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/xkill <playerid>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
SetPlayerHealth(id, 0.0);
SendClientMessage(id, 0x00FF00AA, "You have been killed :o");
SendClientMessage(playerid, 0x00FF00AA, "Player killed");
}
dcmd_money(playerid, params[])
{
new money;
if (sscanf(params, "d", money))SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/money <ammount>\"");
else
{
GivePlayerMoney(playerid, money);
SendClientMessage(playerid, 0x00FF00AA, "[SUCESS]: Money Added");
}
return 1;
}
It would help either by telling me how to solve this or Give me a example GM which has 2-3 dcmd commands in it
Reply
#4

Sorry for the double post
BTW, the script above is just a cut from the OnGameModeInit Callback if that info should help
Reply
#5

Omg, You use it on OnPlayerCommandText not OnGameModeInt
Reply
#6

Not under OnGameModeInIt, under OnPlayerCommandText.

EDIT: aww Kevin beat me to it :P
Reply
#7

Big_Smok3 said i should put it in OnGameModeInit
and i think i will need a simple script that has 2-5 dcmd commands in it
Reply
#8

ok solved my problem i think
Reply
#9

Quote:
Originally Posted by Bcklup
Big_Smok3 said i should put it in OnGameModeInit
and i think i will need a simple script that has 2-5 dcmd commands in it
Well he is wrong https://sampwiki.blast.hk/wiki/Fast_Commands

If you need any help (since you "think" that it is fixed) just ask
Reply
#10

lol sorry i confused is onplayercommandtext sorry for causing problems.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)