help with /nrg
#1

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

here
Reply
#3

why are you mean to me
Reply
#4

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

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

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

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

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

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)