23.08.2009, 09:56
hey i get the following errors:
this is my code:
Line 728:
Line 730:
any help?
Код:
C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(728) : warning 219: local variable "pname" shadows a variable at a preceding level C:\Users\user\Desktop\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\testdcmd.pwn(730) : error 017: undefined symbol "cmdtext" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(test, 4, cmdtext); dcmd(seafun, 6, cmdtext); return 0; } dcmd_test(playerid, params[]) { #pragma unused params new pname[24], string[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "%s is PRO!", pname); SendClientMessage(playerid, 0x00FF00AA, "this was a test"); SendClientMessageToAll(0x00FF00AA, string); { TextDrawShowForAll(Textdraw10); new pname[24]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "%s has gone to %s", pname, cmdtext); Textdraw10 = TextDrawCreate(202.000000,4.000000, string); TextDrawAlignment(Textdraw10,0); TextDrawBackgroundColor(Textdraw10,0x000000ff); TextDrawFont(Textdraw10,3); TextDrawLetterSize(Textdraw10,0.399999,1.300000); TextDrawColor(Textdraw10,0xff0000ff); TextDrawSetOutline(Textdraw10,1); TextDrawSetProportional(Textdraw10,1); TextDrawSetShadow(Textdraw10,1); } return 1; } dcmd_seafun(playerid, params[]) { #pragma unused params SetPlayerPos(playerid, 2450.2224, -1788.5258, 458.3834); new pname[24], string[128]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "[Teleport] %s Has gone to /seafun", pname); SendClientMessage(playerid, 0x00FF00AA, "You have teleported to seafun."); SendClientMessageToAll(0x00FF00AA, string); return 1; }
Код:
new pname[24];
Код:
format(string, sizeof(string), "%s has gone to %s", pname, cmdtext);