disarm
#1

One little command /disarm id please?

Thx.
Reply
#2

um... oh! wait wait...


Reply
#3

Quote:
Originally Posted by SilentHuntR
um... oh! wait wait...


lolz...

but what you're command would do
/disarm
Weapon?
plane?
bomb?
Reply
#4

ResetPlayerWeapons.
Reply
#5

Quote:
Originally Posted by SilentHuntR
um... oh! wait wait...


lol
Idk maybe like this :P
pawn Код:
new cmd[256];
new tmp, giveplayerid, idx;
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/disarm", true) == 0)
{
   if(!IsPlayerAdmin(playerid))
  {
      SendClientMessage(playerid, COLOR_WHITE, "You must be admin.");
      return 1;
  }
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp))
  {
      SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm (id)");
      return 1;
  }
  giveplayerid = strval(tmp);
  if(IsPlayerConnected(giveplayerid)
  {
      SendClientMessage(playerid, COLOR_WHITE, "Inactive player ID.");
      return 1;
  }
  else if(IsPlayerConnected(giveplayerid)
  {
     ResetPlayerWeapons(giveplayerid);
     return 1;
  }
}
Reply
#6

Quote:
Originally Posted by -Seif-
Corrected version:
pawn Код:
new cmd[256];
new tmp, giveplayerid, idx;
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/disarm", true) == 0)
{
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You must be admin.");
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm (id)");
  giveplayerid = strval(tmp);
  if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Inactive player ID.");
  ResetPlayerWeapons(giveplayerid);
  return 1;
}
Well then.... :P I just like to type it out the other way so it's less confusing but your way is more efficient.
Reply
#7

Quote:
Originally Posted by Seif_
Corrected version:
pawn Код:
new cmd[256];
new tmp, giveplayerid, idx;
cmd = strtok(cmdtext, idx);

if(strcmp(cmd, "/disarm", true) == 0)
{
  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You must be admin.");
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm (id)");
  giveplayerid = strval(tmp);
  if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Inactive player ID.");
  ResetPlayerWeapons(giveplayerid);
  return 1;
}
Thanx it really worked, and i needed that
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)