30.12.2017, 07:30
So I checked this command IG for bugs. When I use it for the first time, it works fine. I tried it again(i used a command to exit the DM zone), but now it doesn't. Much more, it does not let me chat, it does not let me use a command. Whenever I type in anything in the chatbox and enter it, nothing happens.
Lobby command
PHP код:
CMD:dm(playerid, params[])
{
if(isinarena[playerid] == 1) return 1;
new id,str1[2];
if(sscanf(params, "I", id)) return SendClientMessage(playerid, 0xFF000000, "/dm [ID]");
valstr(str1, id);
if(str1[1] == '\0' || str1[0] == '\0')
{
new str11[750],string[200];
for(new i=0;i<3;i++)
{
format(string, sizeof(string), "%d\t%s\t%d\t%d\n",MapArenas[i][MapID],MapArenas[i][MapName],mapplayers[i],MapArenas[i][MapCapacity]);
strcat(str11, string);
}
format(string, sizeof(string), "Map ID\tMap Name\tMap Players\tMap Capacity\n%s", str11);
ShowPlayerDialog(playerid, DIALOG_AMAPS, DIALOG_STYLE_TABLIST_HEADERS, "Deathmatch Maps",
string, "Enter", "Cancel");
}
else
{
isinarena[playerid] = 1;
//new rand = random(10);
//if(rand == 1)
//{
SetPlayerPos(playerid, MapArenas[id][MapPosition][0], MapArenas[id][MapPosition][1], MapArenas[id][MapPosition][2]);
SetPlayerFacingAngle(playerid, MapArenas[id][MapPosition][3]);
SetPlayerVirtualWorld(playerid, ARENA_VW);
SetPlayerInterior(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][0], 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][1], 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][2], 100);
GivePlayerWeapon(playerid, MapArenas[id][MapWeapon][3], 100);
new string[70];
format(string, sizeof(string), "You have joined the %s deathmatch room", MapArenas[id][MapName]);
SendClientMessage(playerid, 0x00FF00FF, string);
mapplayers[id]++;
//}
}
return 1;
}
PHP код:
CMD:lobby(playerid)
{
if(shottimerleft[playerid] > 0)
{
SendClientMessage(playerid, 0xFF0000FF, "You have taken damage and have to wait the 10 seconds before exiting the area.");
}
else
{
SetPlayerPos(playerid, SPAWN_X, SPAWN_Y, SPAWN_Z);
SetPlayerInterior(playerid, SPAWN_INT);
SetPlayerVirtualWorld(playerid, SPAWN_VW);
SetPlayerHealth(playerid, 999999);
SetPlayerArmour(playerid, 999999);
ResetPlayerWeapons(playerid);
isinarena[playerid] = 0;
killspree[playerid] = 0;
}
return 1;
}