[Help]Problem with /veh - 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]Problem with /veh (
/showthread.php?tid=339009)
[Help]Problem with /veh -
Danny1 - 01.05.2012
I have made a command /veh and how to put player in vehicle when he enter the id of that car and color?
pawn Код:
CMD:veh(playerid, params[])
{
if(PI[playerid][Admin] >=1 || IPA(playerid))
{
new veh,color1,color2, string[128];
if (!sscanf(params, "iii", veh, color1,color2))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
AddStaticVehicle(veh, x,y,z,0,color1, color2);
PutPlayerInVehicle(playerid, veh, 0);
format(string, sizeof(string), ""COL_SVIJETLOPLAVA"| FriXion | Spawnao si sebi vozilo "COL_SVIJETLOPLAVA"%s(ID: %d)", ImenaVozila, veh);
SCM(playerid, BIJELA, string);
}
else SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"/veh [ID Auta] [Boja 1] [Boja 2]");
}
else SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Zao nam je,nemate mogucnost da koristite ovu komandu.");
return 1;
}
Re: [Help]Problem with /veh -
Folder - 01.05.2012
pawn Код:
CMD:veh(playerid, params[])
{
if(PI[playerid][Admin] >=1 || IPA(playerid))
{
new veh,veh2,color1,color2, string[128];
if (!sscanf(params, "iii", veh, color1,color2))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
veh2 = AddStaticVehicle(veh, x,y,z,0,color1, color2);
PutPlayerInVehicle(playerid, veh2, 0);
format(string, sizeof(string), ""COL_SVIJETLOPLAVA"| FriXion | Spawnao si sebi vozilo "COL_SVIJETLOPLAVA"%s(ID: %d)", ImenaVozila, veh);
SCM(playerid, BIJELA, string);
}
else SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"/veh [ID Auta] [Boja 1] [Boja 2]");
}
else SCM(playerid, BIJELA, ""COL_SVIJETLOPLAVA"| FriXion | "COL_BIJELA"Zao nam je,nemate mogucnost da koristite ovu komandu.");
return 1;
}
Re: [Help]Problem with /veh -
iRemix - 01.05.2012
You should change AddStaticVehicle to CreateVehicle, because then you can destroy it.