SA-MP Forums Archive
Command is bugged - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command is bugged (/showthread.php?tid=94012)



Command is bugged - GforceNL - 27.08.2009

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?



Re: Command is bugged - kaisersouse - 27.08.2009

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?


Re: Command is bugged - NEW_IE - 27.08.2009

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