SA-MP Forums Archive
how to make this command - 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: how to make this command (/showthread.php?tid=152894)



how to make this command - hardstop - 06.06.2010

like /buyveh (carid) (color1) (color2)

i have same saving system as godfather, how can i make /buyveh
can somebody give me an example because i know how to make command but i dont know how to make like the car to a person name etc


Re: how to make this command - DJDhan - 06.06.2010

I can show you how to spawn a car with all those parameters but i don't know much about GodFather's saving system so you have to save it yourself.


Код:
dcmd_buyveh(playerid,params[])
{
  new tmp[128],tmp2[128],tmp3[128],model,color1,color2,veh,Index; new Float:x, Float:y, Float:z, Float:rot;
  GetPlayerPos(playerid,x,y,z);
  GetPlayerFacingAngle(playerid,rot);
  tmp=strtok(params,Index);
  tmp2=strtok(params,Index);
  tmp3=strtok(params,Index);
  if(!strlen(tmp) || !strlen(tmp2) || !strlen(tmp3)) return SendClientMessage(playerid, oxffffffaa, " Usage: /buyveh model color1 color2 ");
 
  
  model=strval(tmp);
  color1=strval(tmp2);
  color2=strval(tmp3);


  veh = CreateVehicle(model,x+3,y+3,z+1,rot,color1,color2,5000);
  PutPlayerInVehicle(playerid,veh,0);
  
  return 1;
}