Command is bugged
#1

My command is bugged
When i type it ingame The server crashes :S
Код:
	if(strcmp(cmd, "/tphousecar", true) == 0 && IsPlayerConnected(playerid))
	{
		GetPlayerName(playerid, playername, sizeof(playername));
		tmp = strtok(cmdtext, idx);

		new Float:hX, Float:hY, Float:hZ, Float:h;
		GetPlayerPos(playerid, hX, hY, hZ);
		new Auto = GetPlayerVehicleID(playerid);
    GetVehicleZAngle(Auto, h);

		if(!strlen(tmp))
		{
			SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /tphousecar [houseid]");
			return 1;
		}
		new house = strval(tmp);
		if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 105 && IsPlayerConnected(playerid))
		{
			HouseCarSpawns[house][cSpawna] = hX;
			HouseCarSpawns[house][cSpawnb] = hY;
			HouseCarSpawns[house][cSpawnc] = hZ;
			HouseCarSpawns[house][cSpawnd] = h;
			SendClientMessage(playerid, COLOR_PURPLE, string);
			OnPropUpdate();
			RemovePlayerFromVehicle(playerid);
			DestroyVehicle(Auto);
			DestroyVehicle(house+1);
			CreateVehicle(HouseInfo[house][hVec],HouseCarSpawns[house][cSpawna],HouseCarSpawns[house][cSpawnb],HouseCarSpawns[house][cSpawnc],HouseCarSpawns[house][cSpawnd],HouseInfo[house][hVcol1],HouseInfo[house][hVcol2],420000);
			PutPlayerInVehicle(playerid, house+1, 0);
			format(string, sizeof(string), "Housecar has been transported to its new location, car respawned!");
			SendClientMessage(playerid, COLOR_PURPLE, string);
			return 1;
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "You are not an admin.");
		}
		return 1;
	}
The code ^

Does Somebody knows whats Wrong?
Reply


Messages In This Thread
Command is bugged - by GforceNL - 27.08.2009, 17:13
Re: Command is bugged - by kaisersouse - 27.08.2009, 17:22
Re: Command is bugged - by NEW_IE - 27.08.2009, 19:02

Forum Jump:


Users browsing this thread: 1 Guest(s)