Simple problem I Cant seem to Pick out -_-
#1

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

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.
Reply
#3

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.
Reply
#4

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

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

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

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

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)
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)