Destroy vehicle cmd, to dcmd [Help please]
#1

Код:
//------------------------------------------------------------------------------
if(strcmp(cmd, "/dvec", true) == 0)
{
  if (AccountPL[playerid][KzAdmin] >= 5)
  {
    new obj2id = strval(strtok(cmdtext, idx));
    if(!obj2id)
	{
      SendClientMessage(playerid, WHITE, "USAGE: /dvec [ID]");
      return 1;
    }
    format(string, sizeof(string), "Vehicle: %d destroyed successfully", obj2id);
    SendClientMessage(playerid,GREEN, string);
    RemovePlayerFromVehicle(obj2id);
    DestroyVehicle(obj2id);
    return 1;
  }
  else
  {
	SendClientMessage(playerid,RED,"NO!");
  }
  return 1;
}
I need to put all this code in dcmd, but I have no idea how to do it, can anybody help me please?
Reply
#2

Try this (Not Tested):
pawn Код:
dcmd_dvec(playerid,params[])
{
if(AccountPL[playerid][KzAdmin] >= 5)
{
if(!strlen(params))
return SendClientMessage(playerid, WHITE, "USAGE: /dvec [ID]");

new obj2id = strval(params);
format(string, sizeof(string), "Vehicle: %d destroyed successfully", obj2id);
SendClientMessage(playerid,GREEN, string);
RemovePlayerFromVehicle(obj2id);
return DestroyVehicle(obj2id);
}
else return SendClientMessage(playerid,RED,"NO!");
}
}
Reply
#3

Thank you, it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)