something broke
#2

There are so many things wrong with that code.

• The indentation is awful.
• You spelt 'You're' wrong.
• You format a message but don't need to
• You have unnecessary else's
• You have misplaced brackets and returns
• giveplayerid, cmd, and tmp are never used (cmd is empty, that's why it spawns a hydra.)

Also don't use the #define FILTERSCRIPT stuff, just remove it.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/hydra", true))
  {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    PutPlayerInVehicle(playerid,CreateVehicle(520, x, y, z, 82.2873, 0, 1, 0),0);
    SendClientMessageToAll(COLOR_YELLOW, "One Hydra :) Happy Flying!");
    return 1;
  }
  if(!strcmp(cmdtext, "/gmx", true))
  {
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, "You're not an admin.");
    new name[MAX_PLAYER_NAME],string[64];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "!!!!! %s RESTARTED THE SERVER !!!!!!", name);
    SendClientMessageToAll(COLOR_YELLOW, string);
    SendRconCommand("gmx");
    return 1;
  }
return 0;
}
Reply


Messages In This Thread
something broke - by kylebrown - 09.12.2009, 23:04
Re: something broke - by Mikep. - 09.12.2009, 23:42
Re: something broke - by kylebrown - 09.12.2009, 23:53
Re: something broke - by Mikep. - 09.12.2009, 23:55
Re: something broke - by kylebrown - 10.12.2009, 00:02

Forum Jump:


Users browsing this thread: 1 Guest(s)