[Help] need command
#1

Hello , I have this command:
Код:
	if (strcmp("/neon", cmdtext, true, 10) == 0)
	{
	new neon = CreateObject(18647,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(neon, GetPlayerVehicleID(playerid), -1.049999,0.075000,-0.450000,0.000000,0.000000,0.000000);
	return 1;
	}
And I need another command where this objects would be removed?

If there are some grammar mistakes sorry, my English is not very good
Reply
#2

PHP код:
if (strcmp("/neonoff"cmdtexttrue10) == 0)
    {
    
DestroyObject(neon);
    return 
1;
    } 
Reply
#3

I got an error :/

Код:
error 017: undefined symbol "neon"
Reply
#4

pawn Код:
if (strcmp("/neonoff", cmdtext, true, 10) == 0)
{
    new neon = CreateObject(18647,0,0,-1000,0,0,0,100);
    DestroyObject(neon);
    return 1;
}
Reply
#5

Add this somewhere in your script:

pawn Код:
new Neon[MAX_VEHICLES];
Replace these lines:
pawn Код:
new neon = CreateObject(18647,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(neon, GetPlayerVehicleID(playerid), -1.049999,0.075000,-0.450000,0.000000,0.000000,0.000000);
With this:
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
Neon[vehicleid] = CreateObject(18647,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(Neon[vehicleid], vehicleid, -1.049999,0.075000,-0.450000,0.000000,0.000000,0.000000);
Then in your /neonoff command replace the lines you have with this:
pawn Код:
vehicleid = GetPlayerVehicleID(playerid);
DestroyObject(Neon[vehicleid]);
Reply
#6

Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)