Vehicle Spawn
#1

My script not work. Help me.

Код:
#include <a_samp>
#include <sscanf2>

new Vehicle;

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnPlayerCommandText( playerid, cmdtext[])
{
 	dcmd(spawn,5,cmdtext); //to zawsze dajemy w publicu!
	return 0;
}



SpawnVehicle(playerid, vehicleid)
{
	new Float:X, Float:Y, Float:Z, Float:A;
	GetPlayerPos(playerid, X, Y, Z);
	GetPlayerFacingAngle(playerid, A);
	Vehicle = CreateVehicle(vehicleid, X, Y, Z, A, 1, 169, -1);
	PutPlayerInVehicle(playerid, Vehicle, 0);

	new Text3D:vehicle3Dtext;
    new i;
    for(i=0;i<MAX_PLAYERS;i++)
   	{
   	if(i != playerid)
	{
	SetVehicleParamsForPlayer(Vehicle,i, 0, 1);
	}
    vehicle3Dtext = Create3DTextLabel( "Private Car! /spawn", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
    Attach3DTextLabelToVehicle( vehicle3Dtext, Vehicle, 0.0, 0.0, 2.0);
	}
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	DestroyVehicle(Vehicle);
	return 1;
}

dcmd_spawn(playerid,params[])
{
	new own;
 	if(sscanf(params,"us",own)) return SendClientMessage(playerid,0xFFFFFAA,"Usage: /spawn (Vehicle ID) ");
 	SpawnVehicle(playerid, own);
 	return 1;
}
I write /spawn and SERVER: Command...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)