Problems with my /spawn command
#7

No... i need something to spawn all the vehicles.
I already made an array with all th vehicles and datas... only a few are missing.
They will be coming soon.
But I posted the code already.
And when i type something like "/spawn hydra" it
But when i type "/spawn avdsgbhjnck" it should give me something like "SERVER: Fahrzeug existiert nicht"
But it spawns me a pcj and shows me the id 521 ... whats wrong? (the pcj is in the place '62' in my array and i only do +400 when spawning)
BTW: i only tested with vehicles up to 520 and i commented the rest of my array

Regards

//EDIT: oh lol why the code is missing?!
CODE:
Код:
CMD:spawn(playerid, params[])
{
	if (IsPlayerAdmin(playerid) || Player[playerid][ALevel] >= 2)
	{
		new Float:x;
		new Float:y;
		new Float:z;
		new Float:a;
		
		new string[256];
		
		for (new i=0; i<sizeof(CreatedVehicles); i++)
		{
			if (CreatedVehicles[i] == 0)
			{
				if (sscanf(params, "s", params[0]))
				{
					SendClientMessage(playerid, RED, "USAGE: /spawn [object]");
					return 1;
				}	
				for ( new j=0; j<gVehMAX; j++ )
				{
					if ( !strcmp(params[0], gVeh[j][eVeh_Name], true) )
					{
						GetPlayerPos(playerid, x, y, z);
						GetPlayerFacingAngle(playerid, a);
						
						CreatedVehicles[i] = CreateVehicle(j+400, x-3, y, z+4, a, 0, 0, -1);
						format(string, sizeof(string), "Fahrzeug \"%s\" (ID: %d) wurde gespawnt.", gVeh[j][eVeh_Name], j+400);
						SendClientMessage(playerid, PURPLE, string);
						return 1;
					}
				}
				SendClientMessage(playerid, RED, "SERVER: Fahrzeug existiert nicht");
			}
		}
	}
	else 
	{
		SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt oder dein AdminLevel ist zu niedrig");
	}
	return 1;
}
Reply


Messages In This Thread
Problems with my /spawn command - by Jonni8 - 18.07.2010, 00:40
Re: Problems with my /spawn command - by Jonni8 - 18.07.2010, 12:59
Re: Problems with my /spawn command - by Jonni8 - 19.07.2010, 14:33
Re: Problems with my /spawn command - by tanush - 19.07.2010, 17:13
Re: Problems with my /spawn command - by [HUN]Jaki - 19.07.2010, 19:03
Re: Problems with my /spawn command - by Jay. - 19.07.2010, 19:06
Re: Problems with my /spawn command - by Jonni8 - 19.07.2010, 19:36
Re: Problems with my /spawn command - by Jonni8 - 21.07.2010, 20:38
Re: Problems with my /spawn command - by [DK]JaloNik - 21.07.2010, 20:58
Re: Problems with my /spawn command - by Jonni8 - 22.07.2010, 14:50

Forum Jump:


Users browsing this thread: 1 Guest(s)