[Tutorial] Simple Commands+Explain
#1

i know that there was many spams on this but anyway i will try to explain.
pawn Код:
// lets try a simple command like heal
if(strcmp, "/heal", cmd, true, 10) == 0)
 SetPlayerHealth(playerid, 100); // so what is this thing? set player heal? what does it mean? it means that when player command /heal its setting hes hp 100
// so if you want to do that command it will look like that:
if(strcmp, "/heal", cmd, true, 10) == 0)
    {
         SetPlayerHealth(playerid, 100); // Do you see the set player health? we explaind it up there :)
         return 1;
    }
// now do think how do we do /kill? so its very easy! just copy the whole heal command and on the playerid, 100 you
// replace the 100 with 0 and the /heal with kill. easy right?
// got it?
// now lets do some other commads.
// here is a command that if player wants a kick, he will get if for sure :).
}
    if (strcmp("/kickme", cmdtext, true, 10) == 0) {
        {SendClientMessage(playerid, 0x33FF33AA, "you wanted a kick and got it :D");
Kick(playerid);return 1;}
}
// now you want pepole to see those commands right? very simple!
if (strcmp("/commands", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0xFFBB00,"Commands: /kickme /heal ");
return 1;
}
// sendclinetmessage? what the hell is that?
// it means that it sends the player (playerid) what that you wrote there!
well i dont have time to add more but i will try to add more and explain more......
hope that it will help new scriptrs...
noder51
or as my scripting name Ninjaa
thanks for looking at this
Reply


Messages In This Thread
Simple Commands+Explain - by noder51 - 19.11.2011, 08:40
Re: Simple Commands+Explain - by SmiT - 19.11.2011, 08:58
Re: Simple Commands+Explain - by noder51 - 19.11.2011, 08:59
Re: Simple Commands+Explain - by SmiT - 19.11.2011, 09:07
Re: Simple Commands+Explain - by noder51 - 19.11.2011, 09:32

Forum Jump:


Users browsing this thread: 2 Guest(s)