/goto and /bring cmd's problem
#1

i have a problem. my admins cmds goto and bring didnt work. here is the code

/goto

Код:
if(strcmp(cmd, "/goto", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Teleports Admin To A Player
	{
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /goto (id)");
  return 1;
  }
  giveplayerid = strval(tmp);

  if(!IsNumeric(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /goto (id) ID Must be a number");
  return 1;
  }
  if (IsPlayerConnected(giveplayerid)) {
  SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
  new Float:x, Float:y, Float:z;
  new pname[24];
  new aname[24];
  GetPlayerPos(giveplayerid, x,y,z);
  SetPlayerPos(playerid, x+1,y,z);
  GetPlayerName(giveplayerid, pname, 24);
  GetPlayerName(playerid, aname, 24);
  SendClientMessage(playerid, 0xA9A9A9AA, "|_Admin Command Used_|");
  format(string, sizeof(string), "You have teleported to %s(%d)",pname,giveplayerid);
  SendClientMessage(playerid,0xFF7F50AA, string);
  format(string, sizeof(string), "%s(%d) has teleported to %s(%d) [ADMIN COMMAND /GOTO]",aname,playerid,pname,giveplayerid);
  printf("%s", string);
  }
  else {
  format(string, sizeof(string), "ID (%d) Is not an active player", giveplayerid);
  SendClientMessage(playerid, COLOR_ERROR, string);
  }
  return 1;
  }
/bring

Код:
if(strcmp(cmd, "/bring", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Brings A Player To Admin
	{
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /bring (id)");
  return 1;
  }
  giveplayerid = strval(tmp);

  if(!IsNumeric(tmp)) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /bring (id) ID Must be a number");
  return 1;
  }
  if (IsPlayerConnected(giveplayerid)) {
  SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
  new Float:x, Float:y, Float:z;
  new pname[24];
  new aname[24];
  GetPlayerPos(playerid, x,y,z);
  SetPlayerPos(giveplayerid, x+1,y,z);
  SetPlayerVirtualWorld(giveplayerid,GetPlayerVirtualWorld(playerid));
  GetPlayerName(giveplayerid, pname, 24);
  GetPlayerName(playerid, aname, 24);
  SendClientMessage(playerid, 0xA9A9A9AA, "|_Admin Command Used_|");
  format(string, sizeof(string), "You have brought (teleported) %s(%d) to you",pname,giveplayerid);
  SendClientMessage(playerid,0xFF7F50AA, string);
  format(string, sizeof(string), "%s(%d) has brought (teleported) %s(%d) [ADMIN COMMAND /BRING]",aname,playerid,pname,giveplayerid);
  printf("%s", string);
  }
  else {
  format(string, sizeof(string), "ID (%d) Is not an active player", giveplayerid);
  SendClientMessage(playerid, COLOR_ERROR, string);
  }
  return 1;
  }
pls help!!!!!!!!!!!!!!!!!!!!!!!!!

also how can i make to show some random msg's while the player is in the server for example: we have houses on the server earn money to buy one.
Reply


Messages In This Thread
/goto and /bring cmd's problem - by billiout - 21.05.2010, 09:32
Re: /goto and /bring cmd's problem - by Naxix - 21.05.2010, 09:45
Re: /goto and /bring cmd's problem - by Retardedwolf - 21.05.2010, 09:46
Re: /goto and /bring cmd's problem - by aircombat - 21.05.2010, 09:48
Re: /goto and /bring cmd's problem - by billiout - 21.05.2010, 09:49
Re: /goto and /bring cmd's problem - by aircombat - 21.05.2010, 10:24
Re: /goto and /bring cmd's problem - by billiout - 21.05.2010, 10:26
Re: /goto and /bring cmd's problem - by billiout - 21.05.2010, 10:50

Forum Jump:


Users browsing this thread: 1 Guest(s)