public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/secret", cmdtext, true, 10) == 0)
{
OnPlayerCommandText(playerid,"secret");
OnPlayerCommandText(playerid,"secret");
return 1;
}
return 0;
}
C:\Users\Darian.Jennifer-PC\Desktop\pawno\xx\new.pwn(95) : warning 217: loose indentation
C:\Users\Darian.Jennifer-PC\Desktop\pawno\xx\new.pwn(101) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Users\Darian.Jennifer-PC\Desktop\pawno\xx\new.pwn(106) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pg", cmdtext, true, 10) == 0)
{
OnPlayerCommandText(playerid,"/me Unzips dufflebag. Takes a weapon out of his dufflebag and Flicks Safety OFF");
OnPlayerCommandText(playerid,"/do **ZIPS**");
return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pg", cmdtext, true, 10) == 0)
{
OnPlayerCommandText(playerid,"/me Unzips dufflebag. Takes a weapon out of his dufflebag and Flicks Safety OFF");
OnPlayerCommandText(playerid,"/do **ZIPS**");
return 1;
}
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
You can only have one:
pawn Код:
Read this: https://sampwiki.blast.hk/wiki/OnPlayerCommandText |
Im still confused how do i make more commands then?? Like how do i add more the link is confusing too. Sorry. I might be a pain in the ass...
Like can i have an example on how to repeat this for more commands? |
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/cmd1", cmdtext, true, 10) == 0)
{
//DO YOUR THING
return 1;
}
if (strcmp("/cmd2", cmdtext, true, 10) == 0)
{
//DO YOUR THING
return 1;
}
//ECT....
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/cmd1", cmdtext, true, 10) == 0)
{
//DO YOUR THING
return 1;
}
else if (strcmp("/cmd2", cmdtext, true, 10) == 0)
{
//DO YOUR THING
return 1;
}
//ECT....
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/pg", cmdtext, true, 10) == 0) { OnPlayerCommandText(playerid,"/me Unzips dufflebag. Takes a weapon out of his dufflebag and Flicks Safety OFF"); OnPlayerCommandText(playerid,"/do **ZIPS**"); return 1; } return 0; } { else if (strcmp("/cmd2", cmdtext, true, 10) == 0) { OnPlayerCommandText(playerid,"/me Unzips dufflebag. Takes a weapon out of his dufflebag and Flicks Safety OFF"); OnPlayerCommandText(playerid,"/do **ZIPS**"); return 1; } return 0; } |
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_WHITE, "your Message"); // define the color
return 1;
}
return 0;
}