SA-MP Forums Archive
[Help]Give player car - 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)
+--- Thread: [Help]Give player car (/showthread.php?tid=497352)



[Help]Give player car - mzazon - 26.02.2014

Resolve it thx you


Re: [Help]Give player car - ReD_HunTeR - 26.02.2014

pawn Код:
CMD:givecar(playerid, params[])
{
   new vid, Float:X, Float:Y, Float:Z, Float:Angle, targetid;
   if(sscanf(params,"d", targetid, vid)) return SendClientMessage(playerid, 0x9C9C9CAA,"Syntax: /car [playerid] [vehicleid]");
   if(vid < 400 || vid > 611) return SendClientMessage(playerid,0xFF0000AA,"Invalid Vehicle ID (400 - 611)");
   GetPlayerPos(targetid, X, Y, Z);
   GetPlayerFacingAngle(targetid, Angle);
   PutPlayerInVehicle(targetid, CreateVehicle(vid, X, Y, Z, Angle, 0, 1, 60), 0);
   return 1;
}



Re: [Help]Give player car - mzazon - 26.02.2014

Quote:
Originally Posted by BlackBomb
Посмотреть сообщение
pawn Код:
CMD:givecar(playerid, params[])
{
   new vid, Float:X, Float:Y, Float:Z, Float:Angle, targetid;
   if(sscanf(params,"d", targetid, vid)) return SendClientMessage(playerid, 0x9C9C9CAA,"Syntax: /car [playerid] [vehicleid]");
   if(vid < 400 || vid > 611) return SendClientMessage(playerid,0xFF0000AA,"Invalid Vehicle ID (400 - 611)");
   GetPlayerPos(targetid, X, Y, Z);
   GetPlayerFacingAngle(targetid, Angle);
   PutPlayerInVehicle(targetid, CreateVehicle(vid, X, Y, Z, Angle, 0, 1, 60), 0);
   return 1;
}
With out sscanf,It confuses me can you make it normal ?


Re: [Help]Give player car - Blademaster680 - 26.02.2014

Just paste that command, that command will do exactly what you need...
If you don't want the sscanf there then just remove that line


Re: [Help]Give player car - mzazon - 26.02.2014

Quote:
Originally Posted by BlackBomb
Посмотреть сообщение
pawn Код:
CMD:givecar(playerid, params[])
{
   new vid, Float:X, Float:Y, Float:Z, Float:Angle, targetid;
   if(sscanf(params,"d", targetid, vid)) return SendClientMessage(playerid, 0x9C9C9CAA,"Syntax: /car [playerid] [vehicleid]");
   if(vid < 400 || vid > 611) return SendClientMessage(playerid,0xFF0000AA,"Invalid Vehicle ID (400 - 611)");
   GetPlayerPos(targetid, X, Y, Z);
   GetPlayerFacingAngle(targetid, Angle);
   PutPlayerInVehicle(targetid, CreateVehicle(vid, X, Y, Z, Angle, 0, 1, 60), 0);
   return 1;
}
Quote:
Originally Posted by Blademaster680
Посмотреть сообщение
Just paste that command, that command will do exactly what you need...
If you don't want the sscanf there then just remove that line
I remove the sscanf line, but the command not working to me...