pawn Код:
if(!strcmp(cmd, "/curar", true)){
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) || !IsNumeric(tmp))return SendClientMessage(playerid, 0xFFFFFFFF, "Uso: /curar <id>");
new id = strval(tmp);
SetPlayerHealth(playerid, 100);
new name[MAX_PLAYER_NAME];
GetPlayerName(id, name, MAX_PLAYER_NAME);
format(tmp, 128, "Server: Has curado a %s(%i)", name, id);
return SendClientMessage(playerid, 0xFFFF00FF, tmp);
}
if(!strcmp(cmd, "/donarsangre", true)){
new tmp[2][256];
tmp[0] = strtok(cmdtext, idx);
tmp[1] = strtok(cmdtext, idx);
if(!strlen(tmp[0]) || !IsNumeric(tmp[0]) || !strlen(tmp[1]) || !IsNumeric(tmp[1]))return SendClientMessage(playerid, 0xFFFFFFFF, "Uso: /curar <id> <cantidad>");
new id, Float:vida, name[MAX_PLAYER_NAME];
id = strval(tmp[0]);
GetPlayerHealth(playerid, vida);
SetPlayerHealth(playerid, vida-strval(tmp[1]);
SetPlayerHealth(id, strval(tmp[1]);
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(tmp, 128, "El jugador %s(%i) te ha donado %i de sangre", name, playerid, strval(tmp[1]));
SendClientMessage(id, 0x00FFFFFF, tmp);
GetPlayerName(id, name, MAX_PLAYER_NAME);
format(tmp, 128, "Le has donado a %s(%i) %i sangre", name, id, strval(tmp[1]));
return SendClientMessage(playerid, 0x00FFFFFF, tmp);
}