Deathmatch zone
#1

Hi all, i have deathmatch zone in my server and i made that when player enter to it, he cannot use other teleports, so when i try to use teleport it works, but it says "SERVER: Unknown message" too and i dont want it to be showed. How can i repair that? Heres code:



Deathmatch teleport:
pawn Код:
new DM[MAX_PLAYERS];

if(!strcmp(cmdtext,"/karas",true) || !strcmp(cmdtext, "/war",true))
{
DM[playerid] = 1;
ResetPlayerWeapons(playerid);
SetKarasRandomSpawn(playerid);
GivePlayerWeapon(playerid, 35, 200);
GivePlayerWeapon(playerid, 16, 200);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetSpawnInfo(playerid, GetPlayerTeam(playerid), GetPlayerSkin(playerid), KarasRandomSpawn[rand][0],  KarasRandomSpawn[rand][1], KarasRandomSpawn[rand][2], KarasRandomSpawn[rand][3], 35, 200, 16, 200, 0, 0);
SetCameraBehindPlayer(playerid);
return 1;
}
Teleport:
pawn Код:
if(!strcmp(cmdtext,"/namai",true) || !strcmp(cmdtext, "/namo",true) || !strcmp(cmdtext, "/home",true))
if (DM[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You cant use commands while in Deathmatch zone");
}
else if (DM[playerid] == 0)
{
if (IsPlayerInAnyVehicle(playerid)) {
SetVehiclePos(GetPlayerVehicleID(playerid),-1797.1227,913.9786,408.3081);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 138.0194);
SetCameraBehindPlayer(playerid);
} else {
SetPlayerPos(playerid, -1752.5966, 893.0681, 299.4500);
SetPlayerFacingAngle(playerid, 270.6842);
SetCameraBehindPlayer(playerid);
}
return 1;
}
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/namai",true) || !strcmp(cmdtext, "/namo",true) || !strcmp(cmdtext, "/home",true))
{
if (DM[playerid] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You cant use commands while in Deathmatch zone");
}
else if (DM[playerid] == 0 || IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),-1797.1227,913.9786,408.3081);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 138.0194);
SetCameraBehindPlayer(playerid);
}
else
{
SetPlayerPos(playerid, -1752.5966, 893.0681, 299.4500);
SetPlayerFacingAngle(playerid, 270.6842);
SetCameraBehindPlayer(playerid);
}
return 1;
}
I think that would work.
Reply
#3

No, it only gives lots of errors.
Reply
#4

Post them.
Reply
#5

Try this:

pawn Код:
if(!strcmp(cmdtext,"/namai",true) || !strcmp(cmdtext, "/namo",true) || !strcmp(cmdtext, "/home",true))
{
  if (DM[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You cant use commands while in Deathmatch zone");
  else if (DM[playerid] == 0 || IsPlayerInAnyVehicle(playerid))
  {
    SetVehiclePos(GetPlayerVehicleID(playerid),-1797.1227,913.9786,408.3081);
    SetVehicleZAngle(GetPlayerVehicleID(playerid), 138.0194);
    SetCameraBehindPlayer(playerid);
  }
  else
  {
    SetPlayerPos(playerid, -1752.5966, 893.0681, 299.4500);
    SetPlayerFacingAngle(playerid, 270.6842);
    SetCameraBehindPlayer(playerid);
  }
  return 1;
}
Reply
#6

I think theres more that you should know, i dont give whole command, becouse theres textdraw message, i tought it is not important, but now i see i need to show it, so heres full command(this gives error):

pawn Код:
if(!strcmp(cmdtext,"/namai",true) || !strcmp(cmdtext, "/namo",true) || !strcmp(cmdtext, "/home",true))
{
if (DM[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You cant use commands while in Deathmatch zone");
else if (DM[playerid] == 0)
{
Destroy(playerid);
new player[24];
GetPlayerName(playerid,player,sizeof(player));
format(tmp,sizeof(tmp),"%s gryzo i Namus: /namai",player,playerid);
Textdraw0 = TextDrawCreate(195.000000,429.000000,tmp);
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,1);
TextDrawLetterSize(Textdraw0,0.399999,1.000000);
TextDrawColor(Textdraw0,0xF7F96EAA);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);
TextDrawShowForAll(Text:Textdraw0);
SetTimer("TextDestroy", 3000, false);
if (IsPlayerInAnyVehicle(playerid)){
SetVehiclePos(GetPlayerVehicleID(playerid),-1797.1227,913.9786,408.3081);
SetVehicleZAngle(GetPlayerVehicleID(playerid), 138.0194);
SetCameraBehindPlayer(playerid);
} else {
SetPlayerPos(playerid, -1752.5966, 893.0681, 299.4500);
SetPlayerFacingAngle(playerid, 270.6842);
SetCameraBehindPlayer(playerid);
}
return 1;
}
Reply
#7

Sorry, solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)