SA-MP Forums Archive
Simple problem I Cant seem to Pick out -_- - 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: Simple problem I Cant seem to Pick out -_- (/showthread.php?tid=213897)



Simple problem I Cant seem to Pick out -_- - Matthew_Johnston - 20.01.2011

Yo People, Whenever I Do this command, It does it to another Person, I Cannot do it To myself
But I want it to Affect me and OTHER Players.
Код:
		if (strcmp("/hammer", cmdtext, true, 5) == 0)
	{
	if(Admin[playerid] == 1)
	{
     new tmp[30];
	 new sendername[24];
     new otherplayer = strval(tmp);
     if(IsPlayerConnected(otherplayer))
     {
          new str[128];
          new othername[24];
          GetPlayerName(playerid, sendername, sizeof(sendername));
          GetPlayerName(otherplayer, othername, sizeof(othername));
          format(str, sizeof(str), "%s Slapped %s With a Huge fucking Hammer.", sendername, othername);
          SendClientMessageToAll(0x33CCFFAA, str);
          format(str, sizeof(str), "%s Slapped you with a BanHammer", sendername); //1582 Pizza Box
          SendClientMessage(otherplayer,0x33CCFFAA,str);
		  Kick(otherplayer);
          return 1;
     }
     SendClientMessage(playerid,0xC2A2DAAA,"Invalid player");
     return 1;
	}
	}
Anyway, If you can pick out the problem Id REALLY appreciate it.
Sorry for my Messy coding XD


Re: Simple problem I Cant seem to Pick out -_- - Haydz - 20.01.2011

If you have bad indention just blame it on the forums .

if you mean you watch to kick you aswell as the other player you could just add Kick(playerid);, although i can't really understand what you really want.


Re: Simple problem I Cant seem to Pick out -_- - MMiz - 20.01.2011

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
if you mean you watch to kick you aswell as the other player you could just add Kick(playerid);
That's what he seems to want... Lol.


Re: Simple problem I Cant seem to Pick out -_- - Matthew_Johnston - 20.01.2011

Well It Seems to be glued on one player, I Cant do the command on myself either.


Re: Simple problem I Cant seem to Pick out -_- - Macluawn - 20.01.2011

what's the problem with just typing your id in /hammer ?


Re: Simple problem I Cant seem to Pick out -_- - Mike Garber - 20.01.2011

Quote:
Originally Posted by Hayden_Bruin
Посмотреть сообщение
If you have bad indention just blame it on the forums .

if you mean you watch to kick you aswell as the other player you could just add Kick(playerid);, although i can't really understand what you really want.
Actually you can't, If the code has good identation when you copy It the forum doesn't change It inside a [*code] or [*pawn] BBCode


Re: Simple problem I Cant seem to Pick out -_- - Matthew_Johnston - 20.01.2011

when I Type My ID It Does it to somebody Else
><


Re: Simple problem I Cant seem to Pick out -_- - Think - 20.01.2011

Maybe because you dont even have something to get the id with, your just creating a new variable 'tmp' and then getting the number out of it (which would obviously return 0) try using something that will actually get the id for you (IE strtok, sscanf)


Re: Simple problem I Cant seem to Pick out -_- - Matthew_Johnston - 20.01.2011

hmm I thought I had strtok in there, Well lemme take a look


Re: Simple problem I Cant seem to Pick out -_- - Haydz - 20.01.2011

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
Actually you can't, If the code has good identation when you copy It the forum doesn't change It inside a [*code] or [*pawn] BBCode
I was making a joke, but ok.