19.11.2009, 17:07
http://pastebin.com/m33893139
I want do make it easy.
If i compile, then my Pawno crashes. Problem is "/raadio".
I want do make it easy.
If i compile, then my Pawno crashes. Problem is "/raadio".
if (PlayerInfo[playerid][pLeader] != 0)
{
teamnumber = PlayerInfo[playerid][pLeader];
}
else
{
if (PlayerInfo[playerid][pMember] != 0)
{
teamnumber = PlayerInfo[playerid][pMember];
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Sa pole orginatsioonides!");
return 1;
}
if(strcmp(cmd,"/raadio",true)==0) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pLeader] != 0) { teamnumber = PlayerInfo[playerid][pLeader]; } else { if (PlayerInfo[playerid][pMember] != 0) { teamnumber = PlayerInfo[playerid][pMember]; } else { SendClientMessage(playerid, COLOR_GRAD1, "Sa pole orginatsioonides!"); return 1; } } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "KASUTAMINE: (/r)aadio [radio chat]"); return 1; } for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { format(string, sizeof(string), "(( %s: %s ))",sendername, result); SendRadioMessage(teamnumber, TEAM_RADIO_COLOR, string); printf("%s", string); format(string, sizeof(string), "* %s kasutab raadiosaatjat.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } return 1; }
C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20217) : error 017: undefined symbol "teamnumber" C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20217) : warning 215: expression has no effect C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20223) : error 017: undefined symbol "teamnumber" C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20223) : warning 215: expression has no effect C:\Documents and Settings\Administraator\Desktop\San Andreas Multiplayer server\gamemodes\*****.pwn(20255) : error 017: undefined symbol "teamnumber" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
if(strcmp(cmd,"/raadio",true)==0) { if(IsPlayerConnected(playerid)) { new teamnumber; if (PlayerInfo[playerid][pLeader] != 0) { teamnumber = PlayerInfo[playerid][pLeader]; } else { if (PlayerInfo[playerid][pMember] != 0) { teamnumber = PlayerInfo[playerid][pMember]; } else { SendClientMessage(playerid, COLOR_GRAD1, "Sa pole orginatsioonides!"); return 1; } } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "KASUTAMINE: (/r)aadio [radio chat]"); return 1; } for(new i = 0; i < MAX_PLAYERS; i++) { if (IsPlayerConnected(i)) { format(string, sizeof(string), "(( %s: %s ))",sendername, result); SendRadioMessage(teamnumber, TEAM_RADIO_COLOR, string); printf("%s", string); format(string, sizeof(string), "* %s kasutab raadiosaatjat.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } } return 1; }