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

Quote:
Originally Posted by GforceNL
SendClientMessage(playerid, COLOR_PURPLE, string);
OnPropUpdate();
is string formatted yet? I don't see anything being formated before you send string for the first time.

Also, what is in OnPropUpdate?
Reply
#3

Quote:
Originally Posted by kaisersouse
Quote:
Originally Posted by GforceNL
SendClientMessage(playerid, COLOR_PURPLE, string);
OnPropUpdate();
is string formatted yet? I don't see anything being formated before you send string for the first time.

Also, what is in OnPropUpdate?
OnPropUpdate is on GF scripts to update the Property example the house.
So it will save to the property file if something is changed like the house car or something

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)