if(strcmp(cmdtext, "/needtaxi", true) == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof (pname)); format(string, sizeof(string), " %s potrzebuje Taxi", pname); SendClientMessage(playerid, COLOR_GREEN, string); // return 1;} else if(strcmp(cmdtext, "/wtaxi", true) == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof (pname)); format(string, sizeof(string), " %s nie potrzebuje juz Taxi", pname); SendClientMessage(playerid, COLOR_GREEN, string); // return 1;} else if(strcmp(cmd, "/taxi", true) == 0) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof (pname)); format(string, sizeof(string), " %s jest taksowkarzem. Jak chcesz go uzyc wpisz /needtaxi", pname); SendClientMessage(playerid, COLOR_GREEN, string); // return 1;}
C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1907) : error 017: undefined symbol "string" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1907) : error 017: undefined symbol "string" C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1907) : error 029: invalid expression, assumed zero C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1907) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
format(string, sizeof(string), " %s potrzebuje Taxi", pname);
C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1831) : warning 219: local variable "string" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
Originally Posted by Pandabeer1337
where did you put new string[128];
|
public OnPlayerCommandText(playerid, cmdtext[]) { new string[128]; new idx; if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me { if(!cmdtext[3]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE/UŻYCIE: /me [action/akcja]"); new string[128], name[16]; GetPlayerName(playerid, name, sizeof(name)); format(string, 128, "*** %s %s", name, cmdtext[4]); SendClientMessageToAll(COLOR_LIGHTGREEN, string); return 1; }
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(!cmdtext[3]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE/UŻYCIE: /me [action/akcja]");
new string[128], name[16]; // new "string" here!!!
GetPlayerName(playerid, name, sizeof(name));
format(string, 128, "*** %s %s", name, cmdtext[4]);
SendClientMessageToAll(COLOR_LIGHTGREEN, string);
return 1;
}
Originally Posted by [B2K
Hustler ]
double post! Depends on how most your commands are. If most of your commands are like this: i.e. it has new string somewhere in the command... pawn Код:
If not, then delete new string from that command. The error message is saying that you have two strings named "string" at the same time. |
C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1946) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.