Help my code - 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 my code (
/showthread.php?tid=656841)
Help my code -
tobi736 - 25.07.2018
im script my own system, and i want to ask because is hard
how i can create a vehicle to players? like player use commands /abc then the a certain car will be spawn?
Please help me, thanks all!!
Re: Help my code -
3417512908 - 25.07.2018
Use zcmd to create one(If you don't have it.Use search to find it)
Код:
CMD:abc(playerid)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateVehicle(411, x, y, z, 0.0, 50, 50, -1);
return 1;
}
Re: Help my code -
Florin48 - 25.07.2018
I think you need a personal vehicle system, look for one and implement it, it's very hard to make one on the spot, a simple command is easy but a whole system is hard.
Re: Help my code -
DAKYSKYE - 25.07.2018
Well, first you need good command processor, for example: YashasSamaga's SmartCMD (which is very powerful cmd processor), place it in pawno/includes directory and then include it
Код HTML:
#include <smartcmd>
Then it depends what you want. If you want to spawn for example NRG-500 when you type command
"abc", the code would look like this:
PHP код:
CMD:abc(cmdid, playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateVehicle(522, x+0.5, y, z, 0.0, 0, 3, -1);
return CMD_SUCCESS;
}
But if you want command which can spawn any vehicle (by writing vehicle id after command), you can search for it on this forum.
Re: Help my code -
tobi736 - 26.07.2018
i'm compiler the code success, but have a bug
how to fix it?
Quote:
[15:32:41] [debug] AMX backtrace:
[15:32:41] [debug] #0 000f907c in ?? (0, 74) from days.amx
[15:32:41] [debug] #1 00159554 in public cmd_chetaoxe (0, 8313060) from days.amx
[15:32:41] [debug] #2 native CallLocalFunction () from samp-server.exe
[15:32:41] [debug] #3 0000af78 in public OnPlayerCommandText (0, 8313020) from days.amx
|