SA-MP Forums Archive
Destroy vehicle cmd, to dcmd [Help please] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Destroy vehicle cmd, to dcmd [Help please] (/showthread.php?tid=130511)



Destroy vehicle cmd, to dcmd [Help please] - Mishima - 27.02.2010

Код:
//------------------------------------------------------------------------------
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?


Re: Destroy vehicle cmd, to dcmd [Help please] - LuxurioN™ - 27.02.2010

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!");
}
}



Re: Destroy vehicle cmd, to dcmd [Help please] - Mishima - 27.02.2010

Thank you, it worked