SA-MP Forums Archive
[Help]Heal command - 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]Heal command (/showthread.php?tid=157509)



[Help]Heal command - Giotis11 - 06.07.2010

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


Re: [Help]Heal command - DJDhan - 06.07.2010

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



Re: [Help]Heal command - TheKingOfSamp - 06.07.2010

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

    //Rest of your healing script
    return 1;
}



Re: [Help]Heal command - Giotis11 - 07.07.2010

emm i get 4 errors


Re: [Help]Heal command - oliverrud - 07.07.2010

What 4 errors?