#define MAX_ROOMS 100
enum PlayerMultiplayer
{
Ready,
Hoster
};
new pM[MAX_PLAYERS][PlayerMultiplayer];
enum RoomMultiplayer
{
Players,
Rooms,
Hoster[MAX_PLAYER_NAME]
};
new rM[RoomMultiplayer];
new str[12];
format(str, sizeof(str), "N/A");
rM[Hoster] = str;
rM[Rooms] = 0;
rM[Players] = 0;
CMD:multiplayer(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1583.8099,-1688.2061,6.2188))
{
for(new = i; i < MAX_ROOMS; i++)
{
if(rM[Rooms] >= 1)
{
}
}
}
else return SendClientMessage(playerid, COLOR_RED, "You are not in Multiplayer Garage!");
return 1;
}
new rM[RoomMultiplayer];
new rM[MAX_ROOMS][RoomMultiplayer];
CMD:multiplayer(playerid, params[])
{
new string[1024];
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1583.8099,-1688.2061,6.2188))
{
new check;
for(new = i; i < MAX_ROOMS; i++)
{
if(rM[i][Rooms] >= 1)
{
check = 1;
format(string, 1024,"%sPlayers: %i - Hoster: %s\n",string,rM[i][Players], rM[i][Hoster]);
}
}
if(check==0) return ShowPlayerDialog(playerid, 1583, DIALOG_STYLE_MSGBOX, "Multiplayer::ERROR", "There are no rooms available.", "OK", "Cancel");
ShowPlayerDialog(playerid, 1584, DIALOG_STYLE_LIST, "Multiplayer rooms", string, "Choose", "Cancel");
}
else return SendClientMessage(playerid, COLOR_RED, "You are not in Multiplayer Garage!");
return 1;
}
C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(297) : error 091: ambiguous constant; tag override is required (symbol "Hoster") C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(297) : error 047: array sizes do not match, or destination array is too small C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(298) : warning 213: tag mismatch C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(298) : error 033: array must be indexed (variable "rM") C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(299) : warning 213: tag mismatch C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(299) : error 033: array must be indexed (variable "rM") C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(308) : error 091: ambiguous constant; tag override is required (symbol "Hoster") C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(308) : error 047: array sizes do not match, or destination array is too small C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(309) : warning 213: tag mismatch C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(309) : error 033: array must be indexed (variable "rM") C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2220) : error 001: expected token: "-identifier-", but found "=" C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2222) : error 029: invalid expression, assumed zero C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2225) : error 017: undefined symbol "i" C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2224) : warning 204: symbol is assigned a value that is never used: "check" C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2224 -- 2228) : warning 217: loose indentation C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2224 -- 2228) : error 017: undefined symbol "check" C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2230) : warning 209: function "cmd_multiplayer" should return a value C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2231) : error 010: invalid function or declaration C:\DOCUME~1\Justin\MYDOCU~1\AWESOM~1\GAMEMO~1\blank.pwn(2232) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1583)
{
}
if(dialogid == 1584)
{
if(!response) return 1;//If the player clicks cancel, do nothing and close the dialog.
SetPlayerPos(playerid, x, y, z); // The X,Y,Z are to be replaced with the position(entrance) of the room, for example.
//Let's say that the X, Y, Z are stored in rM[MAX_ROOMS][PosX]/PosY/PosZ etc.
SetPlayerPos(playerid, rM[listitem][PosX], rM[listitem][PosY], rM[listitem][PosZ]); //What we're doing here is setting his position towards
//The entrance of the room he chose, which is "listitem"
new string[128];//String.
format(string, 128, "Multiplayer:: You have entered room number %i", listitem); //Explanation of listitem and what it is.
SendClientMessage(playerid, COLOR_RED, string); //Sending the string in red color to the player.
rM[listitem][Players]++;//Increasing the amount of players in the room, since an extra player has joined it.
return 1; //Finished.
}
return 1;
}
enum PlayerMultiplayer
{
Ready,
Hoster,
Room
};
new pM[MAX_PLAYERS][PlayerMultiplayer];
pM[playerid][Room] = roomid;
COMMAND:checkroom(playerid, params[]
{
new
iRoomID,
szMessage[100],
szPlayerName[MAX_PLAYER_NAME];
if(sscanf(params, "i", iRoomID))
{
return SendClientMessage(playerid, COLOR_YELLOW, "USE: /checkroom [room id]");
}
// Check here to make sure they don't choose a crazy room ID
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pM[i][Room] == iRoomID)
{
GetPlayerName(i, szPlayerName, sizeof(szPlayerName));
format(szMessage, sizeof(szMessage), "[Room %i] %s", iRoomID, szPlayerName);
SendClientMessage(playerid, COLOR_WHITE, szMessage);
}
}
return 1;
}
|
[Room 8] BobJohn [Room 8] JohnBob |