Need help with dcmd and sscanf
#2

pawn Код:
dcmd_slap(playerid, params[])
{
    new id;
                    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /Slap <ID>");
                    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected");

            if(PlayerInfo[playerid][AdminLevel] > 1)
            {
                new Float:px, Float:py, Float:pz;
                GetPlayerPosition(id, px, py, pz);
                SetPlayerPosition(id, px, py, pz+15);
                SendClientMessage(id,COLOR_GREY,"You just been slapped, bitch!");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
            }
   

    return 1;
}
under onplayercommandtext
change dmcd to dcmd, and on the kill command you dont need that variable in there btw this code is untested
Reply


Messages In This Thread
Need help with dcmd and sscanf - by CrucixTM - 10.09.2010, 13:04
Re: Need help with dcmd and sscanf - by PinkFloydLover - 10.09.2010, 13:12
Re: Need help with dcmd and sscanf - by CrucixTM - 10.09.2010, 13:16
Re: Need help with dcmd and sscanf - by CrucixTM - 10.09.2010, 13:18
Re: Need help with dcmd and sscanf - by PinkFloydLover - 10.09.2010, 13:42
Re: Need help with dcmd and sscanf - by CrucixTM - 10.09.2010, 13:47

Forum Jump:


Users browsing this thread: 2 Guest(s)