Help my code
#1

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!!
Reply
#2

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

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

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(cmdidplayeridparams[])
{
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        
CreateVehicle(522x+0.5yz0.003, -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.
Reply
#5

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

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)