[Help]Heal command
#1

i need a heal command to work only with 2 classes 0 and 4
ty
Reply
#2

Use a variable to store the class id of the player because under the OnPlayerCommandText callback, you won't be able to get it.

At the top of your script:
Код:
new gPlayerClass[MAX_PLAYERS];
Under your OnPlayerRequestClass(playerid,classid)

Код:
if(classid == 0)
{
    gPlayerClass[playerid] = 0;
}
if(classid == 2)
{
    gPlayerClass[playerid] = 2);
}
Then under your heal command:

Код:
if(!strcmp(cmdtext,"/heal",true))
{
    if(gPlayerClass[playerid] != 0 || gPlayerClass[playerid] != 2)) return 0;

    //Rest of your healing script
    return 1;
}
Reply
#3

Код HTML:
if(!strcmp(cmdtext,"/heal",true))
{
    if(gPlayerClass[playerid] != 0 || gPlayerClass[playerid] != 2)) return 0;

    //Rest of your healing script
    return 1;
}
Reply
#4

emm i get 4 errors
Reply
#5

What 4 errors?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)