ID0 bug and Sound on Lag-Shoot.
#1

So, i tried making 2 admin command.
One was /duel.
And the second one was /spawn.
Well, it works great, but im having that "ID 0 Bug"
It works for anyone else, but not for the player who's id 0.
The ID 0 spawns / duel himself, even though he's using somebodys else id.
Scripts:
Код:
CMD:spawn(playerid, params[])
	{
	    new string[64], name[MAX_PLAYER_NAME],targetname[MAX_PLAYER_NAME];
    	new targetid, id;
	    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "You're not allowed to use this command!");
	    if(sscanf(params, "ui", id)) return SendClientMessage(playerid, -1, "USAGE: /spawn [playerid]");
		GetPlayerName(playerid, name, MAX_PLAYER_NAME);
		GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
		format(string, sizeof(string), "Administrator %s has spawned you.", name);
		SendClientMessage(targetid, COLOR_YELLOW, string);
		SpawnPlayer(targetid);
		return 1;
		}
Код:
CMD:duel(playerid, params[])
	{
		new name[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id, string[128];
		new targetid; //This should find the Target ID, right?
	  	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not allowed to use this command!");
		if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /duel [playerid]");
		GetPlayerName(playerid, name, MAX_PLAYER_NAME); //Gets player name, i guess, lol.
		GetPlayerName(targetid, targetname, MAX_PLAYER_NAME); //Gets the targets name xd
		SetPlayerInterior(playerid, 5); //Sets players/targets interior and pos.
		SetPlayerPos(playerid, 772.111999,-3.898649,1000.728820);
		SetPlayerInterior(targetid, 5);
		SetPlayerPos(targetid, 772.111999,-3.898649,1000.728820);
		format(string, 128, "Administrator %s is now dueling with you", name, targetid); //Sends this to the target.
		SendClientMessage(targetid, COLOR_GREEN, string);
		GivePlayerWeapon(playerid, 24, 500);
		GivePlayerWeapon(playerid, 25, 500);
		GivePlayerWeapon(playerid, 34, 500);
		GivePlayerWeapon(targetid, 24, 500); //Gives the player(dueler) and the target(duelist..?) weapons.
		GivePlayerWeapon(targetid, 25, 500);
		GivePlayerWeapon(targetid, 34, 500);
		return 1;
		}
I don't receive any errors or warnings.
Well, i did try to fix it, but still no luck..
I am actually pretty positive that i scripted it poorly.
Well, then there's the "ding" sound, im using "OnPlayerGIVEDamage", but it only makes the 'ding' sound when i hit somebody's body, and not the lag spot.
/I am trying to fix the ding then currently/
Reply
#2

This should help with fixing your problem.
Reply
#3

Everything is up to date..
Eh, I will just give up it, fixed the lag shoot thing i suppose..
Ignore this topic :d
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)