Announce cmd help Fixed Thx Dice7 -
[SOB]Chris - 13.09.2009
I'm trying to make a command to send a message with the player's name followed by a line of text, but for some reason fails me
Код:
forward Announcecmd(playerid,text1,text2,cartel);
public Announcecmd(playerid,text1,text2,cartel);
{
new name[128];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(name,sizeof(name),"%s %s",name,text1);
SendClientMessageToAll(0x0099ccff,name);
if cartel == 1
{
GameTextForPlayer(playerid,text2,5000,3);
}
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/sf", cmdtext, true, 10) == 0)
{
Teleport(playerid,80,-1977.1107,285.8831,35.1719,0);
Announcecmd(playerid,": go to /sf","asd",1);
return 1;
}
return 0;
}
when i try compile show this errors
ChrisDM.pwn(390) : error 055: start of function body without function header
ChrisDM.pwn(392) : error 021: symbol already defined: "GetPlayerName"
ChrisDM.pwn(395) : error 010: invalid function or declaration
ChrisDM.pwn(406) : error 004: function "Announcecmd" is not implemented
Re: Announce cmd help -
dice7 - 13.09.2009
from
pawn Код:
forward Announcecmd(playerid,text1,text2,cartel);
public Announcecmd(playerid,text1,text2,cartel);
to
pawn Код:
Announcecmd(playerid,text1,text2,cartel)
Stock functions don't need to be public. You also had a ; in the 'public blabla'
Re: Announce cmd help -
[SOB]Chris - 13.09.2009
Код:
Quote:
line 388 Announcecmd(playerid,text1,text2,cartel)
{
new name[128];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(name,sizeof(name),"%s %s",name,text1);
SendClientMessageToAll(0x0099ccff,name);
if (cartel == 1)
{
line 396 GameTextForPlayer(playerid,text2,5000,3);
}
}
|
[quote]
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/sf", cmdtext, true, 10) == 0)
{
Teleport(playerid,80,-1977.1107,285.8831,35.1719,0);
line 405 Announcecmd(playerid,": a ido hacia /sf","asd",1);
return 1;
}
return 0;
}
ChrisDM.pwn(396) : error 035: argument type mismatch (argument 2)
ChrisDM.pwn(38

: warning 203: symbol is never used: "text2"
ChrisDM.pwn(405) : error 035: argument type mismatch (argument 2)
Re: Announce cmd help -
dice7 - 13.09.2009
pawn Код:
Announcecmd(playerid,text1[],text2[],cartel)
Re: Announce cmd help -
legendario - 13.09.2009
Ok i Will Fix U This
Old:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/sf", cmdtext, true, 10) == 0)
{
Teleport(playerid,80,-1977.1107,285.8831,35.1719,0);
Announcecmd(playerid,": go to /sf","asd",1);
return 1;
}
return 0;
}
-------------------------
New:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/sf", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,-1977.1107,285.8831,35.1719,0);
SendClientMessage (playerid, COLOR_RED , "Welcome To SF!");
return 1;
}
return 0;
}
it should work
Re: Announce cmd help -
_Vortex - 13.09.2009
Quote:
Originally Posted by »ŁegenĐ«
Ok i Will Fix U This
Old:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/sf", cmdtext, true, 10) == 0) { Teleport(playerid,80,-1977.1107,285.8831,35.1719,0); Announcecmd(playerid,": go to /sf","asd",1); return 1; } return 0; }
-------------------------
New:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/sf", cmdtext, true, 10) == 0) { SetPlayerPos(playerid,-1977.1107,285.8831,35.1719,0); SendClientMessage (playerid, COLOR_RED , "Welcome To SF!"); return 1;
} return 0; }
it should work
|
That's not what he wants. -.-
Re: Announce cmd help -
legendario - 13.09.2009
Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by »ŁegenĐ«
Ok i Will Fix U This
Old:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/sf", cmdtext, true, 10) == 0) { Teleport(playerid,80,-1977.1107,285.8831,35.1719,0); Announcecmd(playerid,": go to /sf","asd",1); return 1; } return 0; }
-------------------------
New:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/sf", cmdtext, true, 10) == 0) { SetPlayerPos(playerid,-1977.1107,285.8831,35.1719,0); SendClientMessage (playerid, COLOR_RED , "Welcome To SF!"); return 1;
} return 0; }
it should work
|
That's not what he wants. -.-
|
ohh