[Help]Give player car
#1

Resolve it thx you
Reply
#2

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;
}
Reply
#3

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 ?
Reply
#4

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
Reply
#5

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)