Jetpack command not working
#1

////////////////////////////////////////////////SERVER CMDS///////////////////////////
//JETPACK
COMMAND:jetpack(playerid, params[])
{
if(gPlayerClass[playerid] != JETTROOPER);
{
SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF} Only Jettroopers can use jetpack");
}
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
SendClientMessage(playerid, COLOR_RED, "{C3C3C3}[SERVER] {FFFFFF}You have successfully spawned a jetpack");
}

i am working with this include

#include <zcmd>//cmd Include

i am making this jetpack command for a class so please help me correct it
Reply
#2

ZZZzzzzzzzzz
Reply
#3

Do not bump after an hour.
Anyway, use this:
pawn Код:
SetPlayerSpecialAction(playerid,2);
Reply
#4

Quote:
Originally Posted by JimmyCh
Посмотреть сообщение
Do not bump after an hour.
Anyway, use this:
pawn Код:
SetPlayerSpecialAction(playerid,2);
SPECIAL_ACTION_USEJETPACK is defined as 2, nothing changes..

pawn Код:
COMMAND:jetpack(playerid, params[])
{
    if(gPlayerClass[playerid] != JETTROOPER) return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF} Only Jettroopers can use jetpack");
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE_JETPACK);
    SendClientMessage(playerid, COLOR_RED, "{C3C3C3}[SERVER] {FFFFFF}You have successfully spawned a jetpack");
    return 1;
}
Reply
#5

THis gave me errors
Reply
#6

I know it's the same, but he used SPECIAL_ACTION_USE JETPACK, with a " "(space).
I made it easier for him.
Reply
#7

Quote:
Originally Posted by FireWarrior101
Посмотреть сообщение
THis gave me errors
There was space instead of '_'. I edited my post.
Reply
#8

Quote:
Originally Posted by FireWarrior101
Посмотреть сообщение
////////////////////////////////////////////////SERVER CMDS///////////////////////////
//JETPACK
COMMAND:jetpack(playerid, params[])
{
if(gPlayerClass[playerid] != JETTROOPER);
{
SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF} Only Jettroopers can use jetpack");
}
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
SendClientMessage(playerid, COLOR_RED, "{C3C3C3}[SERVER] {FFFFFF}You have successfully spawned a jetpack");
}

i am working with this include

#include <zcmd>//cmd Include

i am making this jetpack command for a class so please help me correct it
TIP : next time use [PAWN] [&/PAWN] with out & of course

Ok , i see that you fergot "else" so instend of yours use this :

pawn Код:
//JETPACK
COMMAND:jetpack(playerid, params[])
{
    if(gPlayerClass[playerid] !=  JETTROOPER);
    {
        SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF} Only Jettroopers can use jetpack");
    }
    else if(gPlayerClass[playerid] == JETTROOPER);
    {
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
        SendClientMessage(playerid, COLOR_RED, "{C3C3C3}[SERVER] {FFFFFF}You have successfully spawned a jetpack");
    }
}
NOTE : maybe because you forget to set his class as jettrooper some where in your script
Reply
#9

yes i forgot to reply it worked

but i need a few understand as i am a rookie but i have done alot of things for my gamemod in 2 days

need understand

pawn Код:
//JETPACK
COMMAND:jetpack(playerid, params[])
{
    if(gPlayerClass[playerid] !=  JETTROOPER); [COLOR="Magenta"]Does != means that if the class isnt jettrooper u cant spawn jetpack somethin like that ? [/COLOR]
    {
        SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF} Only Jettroopers can use jetpack");
    }

else if(gPlayerClass[playerid] == JETTROOPER); ([COLOR="Magenta"]==[/COLOR] [COLOR="Lime"]means that the player class is JetTrooper ?)[/COLOR]
Reply
#10

About your question, yes it does. Also for pawn tags remove that "&".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)