SA-MP Forums Archive
help with /nrg - 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: help with /nrg (/showthread.php?tid=164273)



help with /nrg - FireCat - 30.07.2010

how can i make
like a command that when i put /nrg a nrg-500 spawns?
i havnt a clue


Re: help with /nrg - WillyP - 30.07.2010

here


Re: help with /nrg - FireCat - 30.07.2010

why are you mean to me


Re: help with /nrg - -Xan- - 30.07.2010

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(nrg,3,cmdtext); // 3 because "nrg" has 3 letters
       return 0;
}
dcmd_nrg(playerid,params[])
{
       new Float:X, Float:Y, Float:Z;
       #pragma unused params
       GetPlayerPos(playerid,X,Y,Z);
       AddStaticVehicle(/*NRG VEHICLE ID*/,X,Y,Z,0,0,0); // 1st 0 is for ROTATION, 2nd one and 3rd are for colors, this will be black
       return 1;
}
hope i helped :P


Re: help with /nrg - baske007 - 30.07.2010

Hey,

What he means is: Try to do it yourself. Hint:
https://sampwiki.blast.hk/wiki/CreateVehicle
and
https://sampwiki.blast.hk/wiki/OnPlayerCommandText

Edit: Xan was a bit faster then me


Re: help with /nrg - FireCat - 30.07.2010

Quote:

C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(439) : error 017: undefined symbol "dcmd_nrg"
C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(441) : error 017: undefined symbol "dcmd"
C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(444) : error 017: undefined symbol "dcmd_nrg"
C:\Users\james\Desktop\serverrrrr\gamemodes\Gamemo de.pwn(447) : error 017: undefined symbol "params"

why i get these errors


Re: help with /nrg - -Xan- - 30.07.2010

i hate when newbie scripters are sent to do all by themselves, they're asking for help...not for a "GTFO and search urself"

at least u baske007 told him where to search

to FireCat: all funcions you see in the script on the right like... GivePlayerMoney, CreateObject, SetPlayerColor....etcetc

just type www.wiki.sa-mp.com/wiki/ and then write there what you need help to

example:
www.wiki.sa-mp.com/wiki/AddStaticVehicle
www.wiki.sa-mp.com/wiki/SetPlayerColor


PS: put this on the top of your script, it's to define dcmd commands

pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) &&(dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1



Re: help with /nrg - FireCat - 30.07.2010

ok no thx iv made it my self and im not a newbie i just have some questions like you were borned already knowing everything right?


Re: help with /nrg - -Xan- - 30.07.2010

ye i also am asking something about scripting and no fucking one is answering >_<

what i ment was that when some1 says "how to do this?" ppl shouldnt answer "go search urself"...if they really have to be so mean just don't post...


Re: help with /nrg - Cameltoe - 30.07.2010

Quote:
Originally Posted by FireCat
Посмотреть сообщение
ok no thx iv made it my self and im not a newbie i just have some questions like you were borned already knowing everything right?
You shoudln't brag .. cause you obviously are a newbie .. some redirected you to the right place and their not beeing cocky u guys that are begging for help are .. READ READ READ that's how we all learnt this lovely language ..

heres a working /nrg code anyway haven't tested but should work ..

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/nrg", cmdtext, true, 10) == 0)
    {
        new Float:x, Float:y, Float:z, Float:angle;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, angle);
        new NRG = CreateVehicle(522, x, y, z,angle, 6, 0, 0);
        PutPlayerInVehicle(playerid, NRG, 1);
        return 1;
    }
    return 0;
}