if(strcmp(cmd, "/hpap", true) == 0){
if(!IsPlayerAdmin(playerid)){ // check if player is admin
SendClientMessage(playerid, 0xFF0000FF, "You aren't admin.");
return 1;
}else{
SetPlayerHealth(playerid, 100); // set player's hp to 100
SetPlayerArmour(playerid, 100); // set player's armor to 100
SendClientMessage(playerid, 0x00FF00FF, "[-Admin-] Hp: **** Ap: 100 !");
}
return 1;
}
I need code for all user can use this.
if(strcmp(cmd, "/healme", true) == 0){
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
return 1;
}
where i have to put it in?
im new i have first server but i dont know how to script it in
[COLOR="Blue"]public[/COLOR] OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/healme", true) == 0)
{
[INDENT] SetPlayerHealth(playerid,100); [COLOR="SeaGreen"]// Sets the player health to 100.[/COLOR]
SetPlayerArmour(playerid,100); [COLOR="SeaGreen"]// Sets the player armor to 100.[/COLOR]
return 1; [COLOR="SeaGreen"]// Return 'true' OR '1' is used to notify the server that the command has successfully been processed.[/INDENT][/COLOR]}
return 0;
}
if(strcmp(cmd,"/healall",true) == 0)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
SetPlayerHealth(i,100);
SetPlayerArmour(i,100);
}
}
True, but not everyone has what it takes to be a good scripter.. :tongue:I can tell mostly everyone here sucks at scripting if they haven't even looked at the SA-MP site WHICH HAS THE SERVER FILES IN THE DOWNLOADS SECTION AND A FORUM FOR BETTER HELP..
I think you better make a new thread about this here: GTA:SA Multiplayer - RaGEZONE - MMORPG server development forumsHow to add it to a team if the gamemode have 2 teams?
It can be found in your gamemode. It's a functionwhere to find OnPlayerCommandText ?